Postman collection of the APIs
Nector Custom Checkout APIs (Prod).postman_collection.json
The idea is to allow users with loyalty coins to redeem their loyalty coins and purchase at discounted rate directly at checkout instead of generating a coupon.
Initial Setup:
- Make sure the custom checkout integration is initialized from here: https://merchant.nector.io/integration?identifier=custom_checkout
- Setup the redemption rule
- The secret webhook id can be found in the above link after the integration is initialized.
Here is a simple API that you can use to get the eligible discount for a customer based on the rules defined by you and the customer’s available coins.
- There is a single endpoint platform.nector.io/api/open/integrations/customcheckoutwebhook/:webhook_id that you have to call with different payload. Read below for more information.
- The
webhook_id
part of the endpoint is specific to each merchant, which can be accessed from the nector dashboard or can be provided by the nector team as well.
- Below the general structure of the API payload and response
- The “action” field in the payload decides the operation that is performed.
- if “action” is “list”, then the discount that the customer is eligible for is returned in the response
- if “action” is “perform”, then the coins are deducted from the customer’s wallet, and a wallet transaction is returned.
- if “action” is “revert”, then the coins are given back to the customer (will be useful if the perform action is called but then the order processesing failed for some other reason, then “revert” can be called).
<aside>
⚠️ Don’t call this API from frontend
</aside>
Nector Wallets
We have recently added support for multiple wallets on Nector.