API Integration
How to integrate APIs for rewarding and management
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 keys

API calls without Actions and Rules

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
Adjust wallet points CR
Adjust wallet points DR
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": "unique hash",
10
"operation": "cr",
11
"type": "reward"
12
}'
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": "unique hash",
10
"operation": "cr",
11
"type": "adjust"
12
}'
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": "unique hash",
10
"operation": "dr",
11
"type": "adjust"
12
}'
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!

API calls with Actions and Rules

Rewarding using actions and rules is very straightforward. Just call the Action Activity API to reward your users (soft creation of user is automatic)
post
https://platform.nector.io/api/v2/merchant
/actionactivities
Create Action Activity
Example
Action activity
Action activity (user with existing referral code)
Action activity (use 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
"name": "action-name",
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
"name": "action-name",
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
"name": "action-name",
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
"name": "action-name",
8
"customer_id": "customer-id",
9
"badge": "silver"
10
}'
Copied!
Last modified 15d ago