Developers

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:

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

  1. 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.
  2. Store the key on your server, encrypted. Send it on every call as Authorization: Bearer <key>, in that form: the word Bearer (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.
  3. Call the API at https://app.rewardsnp.com/api/v1. Requests and answers are JSON.
  4. Fetch the campaign list once to find the campaign_id you 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.

  1. When you are about to show the offer, and not before, ask for a link with POST /api/v1/links.
  2. Pass the bill amount as txn_value and your code for the branch as branch, if you have them. Both are optional.
  3. 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.
  4. 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:

Example 2: a till reporting a bill

A billing system reports each paid bill, so the customer's visit counts without anyone scanning anything.

  1. When a bill is paid, call POST /api/v1/visits with the campaign, the bill number as request_id, and the customer's phone number or email address if the cashier took one.
  2. You may send every bill. When a bill has no customer details we answer identifier_required and record nothing. That is the expected answer, not a fault.
  3. The answer to a recorded visit is only accepted and 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:

What we ignore, and how you find out

Two fields never make a call fail, on either endpoint: the bill amount and the branch.

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.

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.

CodeStatusWhat it meansWhat to do
key_missing401No 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_invalid401The 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_revoked401The 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_expired401The key was replaced and its 7 days have passed.Use the key that replaced it.
business_off401The 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_denied403The 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_found404The 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_archived409The business has archived this campaign.Stop sending for this campaign. Show something else.
campaign_not_available409The campaign exists but is not taking customers at the moment.Show something else now; the same call may succeed later.
invalid_json400The request body is not valid JSON.Fix the request. Do not retry unchanged.
body_not_object400The 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_charset400The 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_encoding400The request body is compressed in a way we do not read (Content-Encoding).Send the body uncompressed. Do not retry unchanged.
campaign_required400campaign_id is missing.Send it.
no_sessions400This 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_flow400This 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_required400request_id is missing.Send your bill or order number.
request_id_invalid400request_id must be 1 to 64 visible ASCII characters with no spaces.Send a shorter or plainer value.
identifier_required400The 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_phone400The 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_email400The email address is not valid.Nothing was recorded. Correct the address or drop the visit.
payload_too_large413The request body is far larger than any request here needs to be.Send only the fields the endpoint describes.
not_found404The address or the method is not one of the endpoints of this API.Check the address and the method against this reference.
rate_limited429Too many calls in the last minute.Wait the number of seconds in the Retry-After header, then try again.
error500Something failed on our side.Try again after a short wait. For a visit, send the same request_id so it cannot be counted twice.
busy503The 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.

EndpointCalls a minute, for each connection
GET /api/v1/campaigns60
POST /api/v1/links600
POST /api/v1/visits120

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.