Developers
Connect a till, a billing system or a partner app to a business's RewardsNP campaigns. Your server can create a session link for a customer, record a visit for a customer, and receive a signed message when something happens.
What the API is for
A business runs reward campaigns on RewardsNP. Normally a customer joins in by scanning a QR code that staff show them, or staff log the visit themselves. The API lets another system do those jobs:
- Create a session link. Your system asks for a link and shows it to one customer: as a button, in a message, or as a QR code on a bill. The customer opens it and plays the campaign on their own phone.
- Record a visit. Your system tells us that a customer you can identify, by phone number or email address, has just paid. We record the visit exactly as if staff had logged it.
- List campaigns. So that your settings screen can offer the business a campaign to choose.
In the other direction, webhooks send your server a signed message when a customer's visit is recorded, a reward is earned or handed over, a draw is won, or a customer makes progress. See Webhooks.
The API is for servers. Never call it from a web page or a mobile app: the key would be visible to anyone who looked.
Before you start
- The business creates a connection for your system in its dashboard and gives you the key. The steps are in Connections and keys. You cannot sign up for a key yourself, and the ConvertPlus team never creates one for you.
- Store the key on your server, encrypted. Send it on every call as
Authorization: Bearer <key>, in that form: the wordBearer(its letter case does not matter), one space, then the key. The key itself is exact: send it letter for letter as it was shown. - Call the API at
https://app.rewardsnp.com/api/v1. Requests and answers are JSON. - Fetch the campaign list once to find the
campaign_idyou will use.
Every field is described in the API reference. The same description for machines (OpenAPI 3.1) is at /developers/openapi.json.
Example 1: a partner app shown after a payment
A payment app shows offers on its payment-success screen. One of them invites the customer to play a restaurant's campaign.
- When you are about to show the offer, and not before, ask for a link with
POST /api/v1/links. - Pass the bill amount as
txn_valueand your code for the branch asbranch, if you have them. Both are optional. - Show the link you get back. Use it exactly as returned. To add your own tracking reference, append it with
&under a name of your own. - The customer taps it and the campaign page opens. Everything after that happens between the customer and the page.
Example: A session link, with the bill amount and a branch code
Request
POST /api/v1/links
Authorization: Bearer cpk_3f9a1c2b4d5e_<secret>
Content-Type: application/json
{
"campaign_id": "cmp_example",
"txn_value": 1250,
"branch": "KTM-07"
}Answer
HTTP 200
{
"url": "https://app.rewardsnp.com/c/cli_example/cmp_example.html?sid=eyJjIjoiY21wX2V4YW1wbGUifQ.c2FtcGxl",
"expires_at": "2026-10-03T12:49:56.000Z"
}The values of url and expires_at here are samples: they are different on every call.
Rules of conduct:
- One link, one customer, one time. A link works once and stops working 15 minutes after you ask for it. Never ask for links in advance, and never show the same link to two people.
- Nothing is stored when a link is created. A link that is never opened costs nothing and leaves no record of the link.
- Only for a real payment. A link lets a customer take part as someone who has just paid. Ask for one only when a real payment has just succeeded.
- Do not make the customer wait for us. Put a short time limit on the call, about two seconds. If there is no answer in time, or any answer other than success, show something else.
- You never tell us who the customer is, and we never read your tracking reference.
Example 2: a till reporting a bill
A billing system reports each paid bill, so the customer's visit counts without anyone scanning anything.
- When a bill is paid, call
POST /api/v1/visitswith the campaign, the bill number asrequest_id, and the customer's phone number or email address if the cashier took one. - You may send every bill. When a bill has no customer details we answer
identifier_requiredand record nothing. That is the expected answer, not a fault. - The answer to a recorded visit is only
acceptedand a receipt id. It never says what the customer earned: the customer sees that on the campaign page, and your server can hear about it through webhooks.
Example: Record a visit
Request
POST /api/v1/visits
Authorization: Bearer cpk_3f9a1c2b4d5e_<secret>
Content-Type: application/json
{
"campaign_id": "cmp_example",
"request_id": "BILL-10482",
"phone": "9801234567",
"txn_value": 1250
}Answer
HTTP 200
{
"accepted": true,
"event_id": "rcp_8c1f0a2b3d4e5f60"
}The value of event_id here is a sample: it is different on every call.
Example: The same visit sent again returns the same receipt
Same request_id, same connection, within 90 days: once the key, the purpose, the limit and the shape of campaign_id and request_id have passed, the first call's receipt comes back and nothing new is recorded, whatever the rest of the repeat's body says.
Request
POST /api/v1/visits
Authorization: Bearer cpk_3f9a1c2b4d5e_<secret>
Content-Type: application/json
{
"campaign_id": "cmp_example",
"request_id": "BILL-10482",
"phone": "9801234567",
"txn_value": 1250
}Answer
HTTP 200
{
"accepted": true,
"event_id": "rcp_8c1f0a2b3d4e5f60"
}The value of event_id is the one the example “Record a visit” returned.
Example: A bill with no customer details
The campaign identifies customers by phone number and the call carried none. Nothing is recorded. For a till that reports every bill, this is the normal answer for a bill with no customer.
Request
POST /api/v1/visits
Authorization: Bearer cpk_3f9a1c2b4d5e_<secret>
Content-Type: application/json
{
"campaign_id": "cmp_example",
"request_id": "BILL-10483",
"txn_value": 480
}Answer
HTTP 400
{
"error": {
"code": "identifier_required",
"message": "This campaign needs the customer's phone number or email address.",
"field": "phone"
}
}What a reported visit does. On a "play first, then identify" campaign, the wait between visits (the cooldown) is kept per customer for a reported visit (a customer's own scan is still checked on that customer's device). A second report for the same customer inside the wait, after the visit window has closed, is accepted and gets its receipt id, but it is not recorded as a visit and it gives no reward. When a customer scans and a till also reports the same purchase, they count as one visit on such a campaign, whichever comes first, and rewards are never doubled. This is how the platform's own staff screen behaves too.
Rules of conduct:
request_idis your bill number. If a call times out, send it again with the samerequest_id: you get the same receipt and the visit is not counted twice. We remember arequest_idfor 90 days, per connection. Never put a phone number or an email address in it.- A repeat after 90 days. Once 90 days have passed the
request_idis forgotten: a repeat is treated as a new request and gets a new receipt id. If the earlier request recorded a visit, no second visit and no second reward is recorded. If the earlier request only joined a visit that was already in progress, the repeat, once that visit's window has closed, is recorded as a new visit and can give a reward. So do not re-send a bill after 90 days. - The receipt id is not the webhook's id. The
event_idin this answer is a receipt for the call. Thevisit.recordedwebhook carries its own, differentevent_id. - Sending a customer's number means the customer agreed. The business is responsible for the cashier having asked, exactly as when staff type the number in themselves.
- No backdating. A visit is timed when we receive it; a time you send is not read. Report bills as they are paid, not in a nightly batch.
- Phone numbers follow the business's country: the number in that country's format, optionally preceded by its calling code (a Nepal business: 10 digits, optionally preceded by
+977or977). Spaces and dashes are ignored. A number that does not fit is refused asinvalid_phone. - A name is kept only when the campaign asks for one.
nameis stored only when the campaign's form collects a name; on any other campaign it is accepted and left out, and is not recorded as shared. - The same rules as the counter, with one difference. The campaign's limits apply to a reported visit as to a scanned one. On a "play first, then identify" campaign the wait between visits works differently for a reported visit, as described above. A bill reported while that customer's visit is still open joins that visit instead of starting a second one.
- Prizes the customer chooses. Some campaigns let the customer pick a prize by hand. A reported visit is recorded, and the pick waits for the customer, who makes it on the campaign page. For that the customer needs a session link: the QR code at the counter, or a link your till asks for with
POST /api/v1/linksand prints on the bill. A till that does both needs a connection with both purposes. A hand-picked draw ticket waits in the same way: the report keeps the customer's ticket for the rest of that visit, and the customer gets it by choosing the prize on the campaign page, so they need the same session link.
What we ignore, and how you find out
Two fields never make a call fail, on either endpoint: the bill amount and the branch.
- A
txn_valuethat is not a number of zero or more is treated as not sent. Text that is a plain number, like"12.5", is read as that number; anything else, like"1,200.00", is not. - A
branchwe do not recognise, one the business has retired, or one the campaign does not use is treated as not sent.
We accept the call and ignore the field; the business's Connections card shows what we ignored: how many times, and the last few values exactly as you sent them. If rewards that depend on the bill amount or the branch are not appearing, look there first.
A value we ignore is noted only when the call is accepted. A call we refuse, for any reason (the key, the purpose, the limit, a missing field, the campaign, or a missing or invalid phone number or email address), notes nothing, and neither does a repeat of a visit.
Example: A bill amount we cannot use still gets a link
The amount is text with a comma, not a number. The link is created without an amount, and the business's Connections card shows the value under "what we ignored".
Request
POST /api/v1/links
Authorization: Bearer cpk_3f9a1c2b4d5e_<secret>
Content-Type: application/json
{
"campaign_id": "cmp_example",
"txn_value": "1,250.00"
}Answer
HTTP 200
{
"url": "https://app.rewardsnp.com/c/cli_example/cmp_example.html?sid=eyJjIjoiY21wX2V4YW1wbGUifQ.c2FtcGxl",
"expires_at": "2026-10-03T12:49:56.000Z"
}The values of url and expires_at here are samples: they are different on every call.
A link or a visit is refused only when the key is not good, the campaign is not good, or, for a visit, the customer's phone number or email address is missing or not valid.
Links and your own tracking
Four names in a campaign link belong to us: sid, msg, ref and card. The campaign page ignores every other name.
- Append your own reference with
&, for example&pa_click=83121. We never read it and never store it. - Do not call it
sid,msg,reforcard. In particular, when a link carriessid, arefon it is ignored, so arefyou add does nothing. - Never use
msg. Amsgvalue on a link is recorded as the message that brought the customer, so yours would credit the visit to the wrong thing. - Do not shorten, re-encode or rebuild the link. A changed link may not open.
Errors and what to do
Every answer that is not a success has the same shape:
An error answer
{
"error": {
"code": "identifier_required",
"message": "A plain sentence for a person reading a log.",
"field": "phone"
}
}
Decide what to do from code. The message is for a person reading a log and its wording may change. field is there when the refusal is about one field of your request.
503 with the code busy means the service is busy for a moment: wait the seconds in the Retry-After header and try again. For a visit, send the same request_id on the retry so it cannot be counted twice.
| Code | Status | What it means | What to do |
|---|---|---|---|
key_missing | 401 | No Authorization header was sent, or it is not in the form Bearer <key>: the word Bearer (its letter case does not matter), then one space, then the key. | Send the header on every call, exactly in that form. |
key_invalid | 401 | The key is not one we know: mistyped, cut short, in the wrong form, or a key from another deployment. | Check the key you stored. Do not retry with the same key. |
key_revoked | 401 | The key was switched off, or its connection was switched off. | Tell the business. It creates a new connection or key in its dashboard. Do not retry. |
key_expired | 401 | The key was replaced and its 7 days have passed. | Use the key that replaced it. |
business_off | 401 | The business has been switched off on the platform, so none of its connections work for now. The key itself is not at fault. | Tell the business. Do not retry until it is switched back on; nothing was recorded. |
scope_denied | 403 | The connection's purpose does not cover this endpoint (for example a connection that only creates links tried to record a visit). | The business creates a connection with the right purpose. Do not retry. |
campaign_not_found | 404 | The business has no campaign with this id. Another business's campaign answers the same way, on purpose. | Fetch the campaign list and use an id from it. |
campaign_archived | 409 | The business has archived this campaign. | Stop sending for this campaign. Show something else. |
campaign_not_available | 409 | The campaign exists but is not taking customers at the moment. | Show something else now; the same call may succeed later. |
invalid_json | 400 | The request body is not valid JSON. | Fix the request. Do not retry unchanged. |
body_not_object | 400 | The request body is valid JSON but is not an object: for example a bare number, null or a list. | Send a JSON object, in { }. Do not retry unchanged. |
unsupported_charset | 400 | The request body is not in UTF-8. | Send the body as UTF-8 text (Content-Type: application/json; charset=utf-8). Do not retry unchanged. |
unsupported_encoding | 400 | The request body is compressed in a way we do not read (Content-Encoding). | Send the body uncompressed. Do not retry unchanged. |
campaign_required | 400 | campaign_id is missing. | Send it. |
no_sessions | 400 | This campaign is a kind of page that takes no session links and no visits. | Use a campaign from the campaign list - it only lists campaigns that can be used here. |
wrong_flow | 400 | This campaign is set up in a way that cannot take a visit recorded for it. | Use a session link for this campaign instead. |
request_id_required | 400 | request_id is missing. | Send your bill or order number. |
request_id_invalid | 400 | request_id must be 1 to 64 visible ASCII characters with no spaces. | Send a shorter or plainer value. |
identifier_required | 400 | The campaign needs a phone number or an email address and the call carried none it can use. field names what to send. | Normal for a bill with no customer details: nothing was recorded. Do not retry. |
invalid_phone | 400 | The phone number is not valid in the format of the business's country: the national number, with or without the calling code (a Nepal business: 10 digits, with or without +977). | Nothing was recorded. Correct the number or drop the visit. |
invalid_email | 400 | The email address is not valid. | Nothing was recorded. Correct the address or drop the visit. |
payload_too_large | 413 | The request body is far larger than any request here needs to be. | Send only the fields the endpoint describes. |
not_found | 404 | The address or the method is not one of the endpoints of this API. | Check the address and the method against this reference. |
rate_limited | 429 | Too many calls in the last minute. | Wait the number of seconds in the Retry-After header, then try again. |
error | 500 | Something failed on our side. | Try again after a short wait. For a visit, send the same request_id so it cannot be counted twice. |
busy | 503 | The service is busy for a moment. | Wait the number of seconds in the Retry-After header, then try again. For a visit, send the same request_id: the retry cannot be counted twice. |
Rate limits
Limits are counted per connection, per minute. Over the limit we answer 429 with the code rate_limited and a Retry-After header that says how many seconds to wait.
| Endpoint | Calls a minute, for each connection |
|---|---|
GET /api/v1/campaigns | 60 |
POST /api/v1/links | 600 |
POST /api/v1/visits | 120 |
Calls made with a key that is not good are limited separately. If a business needs a higher limit, it asks its ConvertPlus contact.
Versions and changes
The address carries the version: /api/v1. Within v1 we only add: a new endpoint, a new optional request field, a new response field, a new error code for a new situation. We never remove a field and never change what one means.
So ignore fields you do not know, and treat an error code you do not know as you treat error. Webhook messages carry schema_version and follow the same promise.
Testing
There are no test keys. To try your integration, ask your ConvertPlus contact for a staging copy of the platform. It has its own address, its own businesses and its own keys, and nothing you do there reaches a real customer. A key from staging does not work on the live platform, and a live key does not work on staging.
Questions
Talk first to the business you are integrating for: it owns the connection and can see what we ignored. For anything about the platform itself, contact us.