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
1
curl --location --request POST 'https://platform.nector.io/api/v2/merchant/leads' \
2
--header 'x-apikey: <api-key-in-plain-format>' \
3
--header 'x-source: <source>' \
4
--header 'Content-Type: application/json' \
5
--data-raw '{
6
"customer_id": "customer-id"
7
}'
Copied!
1
curl --location --request POST 'https://platform.nector.io/api/v2/merchant/leads' \
2
--header 'x-apikey: <api-key-in-plain-format>' \
3
--header 'x-source: <source>' \
4
--header 'Content-Type: application/json' \
5
--data-raw '{
6
"customer_id": "customer-id",
7
"referral_code": "referral_code"
8
}'
Copied!
1
curl --location --request POST 'https://platform.nector.io/api/v2/merchant/leads' \
2
--header 'x-apikey: <api-key-in-plain-format>' \
3
--header 'x-source: <source>' \
4
--header 'Content-Type: application/json' \
5
--data-raw '{
6
"customer_id": "customer-id",
7
"referred_by_referral_code": "referred_by_referral_code"
8
}'
Copied!
1
curl --location --request POST 'https://platform.nector.io/api/v2/merchant/leads' \
2
--header 'x-apikey: <api-key-in-plain-format>' \
3
--header 'x-source: <source>' \
4
--header 'Content-Type: application/json' \
5
--data-raw '{
6
"customer_id": "customer-id",
7
"badge": "bronze"
8
}'
Copied!
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
1
curl --request POST \
2
--url https://platform.nector.io/api/v2/merchant/wallettransactions \
3
--header 'x-apikey: <api-key-in-plain-format>' \
4
--header 'x-source: <source>' \
5
--header 'Content-Type: application/json' \
6
--data '{
7
"customer_id": "customer_id",
8
"amount": "10",
9
"hash": "uniquehash",
10
"operation": "cr"
11
}'
Copied!
1
curl --request POST \
2
--url https://platform.nector.io/api/v2/merchant/wallettransactions \
3
--header 'x-apikey: <api-key-in-plain-format>' \
4
--header 'x-source: <source>' \
5
--header 'Content-Type: application/json' \
6
--data '{
7
"customer_id": "customer_id",
8
"amount": "10",
9
"hash": "uniquehash",
10
"operation": "dr"
11
}'
Copied!
post
https://platform.nector.io/api/v2/merchant
/dealrewards
Reward Deal
Example
1
curl --request POST \
2
--url https://platform.nector.io/api/v2/merchant/dealrewards \
3
--header 'x-apikey: <api-key-in-plain-format>' \
4
--header 'x-source: <source>' \
5
--header 'Content-Type: application/json' \
6
--data '{
7
"customer_id": "customer_id"
8
}'
Copied!

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)
1
curl --request POST \
2
--url https://platform.nector.io/api/v2/merchant/actionactivities \
3
--header 'x-apikey: <api-key-in-plain-format>' \
4
--header 'x-source: <source>' \
5
--header 'Content-Type: application/json' \
6
--data '{
7
"trigger_id": "trigger_id",
8
"customer_id": "customer_id"
9
}'
Copied!
1
curl --request POST \
2
--url https://platform.nector.io/api/v2/merchant/actionactivities \
3
--header 'x-apikey: <api-key-in-plain-format>' \
4
--header 'x-source: <source>' \
5
--header 'Content-Type: application/json' \
6
--data '{
7
"trigger_id": "trigger_id",
8
"customer_id": "customer_id",
9
"referral_code": "referral_code"
10
}'
Copied!
1
curl --request POST \
2
--url https://platform.nector.io/api/v2/merchant/actionactivities \
3
--header 'x-apikey: <api-key-in-plain-format>' \
4
--header 'x-source: <source>' \
5
--header 'Content-Type: application/json' \
6
--data '{
7
"trigger_id": "trigger_id",
8
"customer_id": "customer_id",
9
"referred_by_referral_code": "referred_by_referral_code"
10
}'
Copied!
1
curl --request POST \
2
--url https://platform.nector.io/api/v2/merchant/actionactivities \
3
--header 'x-apikey: <api-key-in-plain-format>' \
4
--header 'x-source: <source>' \
5
--header 'Content-Type: application/json' \
6
--data '{
7
"trigger_id": "trigger_id",
8
"customer_id": "customer_id",
9
"badge": "silver"
10
}'
Copied!