API reference
Every endpoint, field and error of the integration API. The same description for machines is at /developers/openapi.json. New here? Start with the overview.
The basics
- Address:
https://app.rewardsnp.com/api/v1. Your ConvertPlus contact confirms the live address and, for testing, a staging address. - Format: JSON in, JSON out. Send
Content-Type: application/jsonwith a body. - Key: send
Authorization: Bearer <key>on every call, with the wordBearer(its letter case does not matter) and one space before the key. The key itself is case-sensitive. A key looks likecpk_, then a 12-character key id, then_, then a long secret. See Connections and keys. - The business is known from the key. There is no field for it, and one you send is not read.
- Purpose: each connection has a purpose: it creates links, records visits, or both. A call outside its purpose is refused with
scope_denied. Listing campaigns works with either. - Times are UTC, in ISO 8601 form, for example
2026-10-03T12:34:56.789Z.
Endpoints
GET /api/v1/campaigns
List the business's campaigns. The campaigns of the key's business that are live and can take a session: running, not archived, not waiting to start, and not a page that takes no customers. Use it to fill a campaign picker on your side. Being listed does not guarantee a visit will be accepted: a visit to a campaign set up in a way that cannot take a reported visit is still refused with wrong_flow. The list says nothing about customers, rewards or figures.
Purpose needed: Creates links or Records visits (either). Limit: 60 calls a minute for each connection.
No request body.
Answer (200)
| Field | Type | Always there | Meaning |
|---|---|---|---|
campaigns | list of object | yes | The business's campaigns that are live and can take a session. |
campaigns[].campaign_id | string | yes | The id to send as campaign_id. |
campaigns[].name | string | yes | The name shown for this campaign: the label customers see on its card. |
campaigns[].identifiers | list of string: phone, email | yes | What identifies a customer on this campaign. One entry: a visit must carry that one. Two entries: either is enough. |
Refusals
| Status | Code | When |
|---|---|---|
| 401 | key_missing | 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. |
| 401 | key_invalid | The key is not one we know: mistyped, cut short, in the wrong form, or a key from another deployment. |
| 401 | key_revoked | The key was switched off, or its connection was switched off. |
| 401 | key_expired | The key was replaced and its 7 days have passed. |
| 401 | business_off | The business has been switched off on the platform, so none of its connections work for now. The key itself is not at fault. |
| 429 | rate_limited | Too many calls in the last minute. |
| 500 | error | Something failed on our side. |
| 503 | busy | The service is busy for a moment. |
POST /api/v1/links
Create a session link. Returns a link that opens the campaign page with a session for ONE customer. The link works once and stops working 15 minutes after it is created. It names no customer. Use the link exactly as returned; to add your own tracking reference, append it with & under a name of your own that is not sid, msg, ref or card. Nothing is stored when a link is created: a link that is never opened costs nothing and leaves no record of the link. A bill amount or a branch that we cannot use never fails the call: the link is created without it.
Purpose needed: Creates links. Limit: 600 calls a minute for each connection.
Request fields
| Field | Type | Required | Meaning |
|---|---|---|---|
campaign_id | string | yes | A campaign of the key's business, from the campaign list. |
txn_value | number or string | no | The bill amount, in the business's currency. Optional. Send a number of zero or more; plain text that is such a number, like "12.5", is read too. Anything else (for example "1,200.00", a negative number, or a number too large to be exact, above 9007199254740991) is ignored: the call goes ahead as if no amount was sent. |
branch | string | no | Your own code for the branch. Optional. The business enters each branch's codes in its dashboard. A code we do not recognise is ignored. |
Answer (200)
| Field | Type | Always there | Meaning |
|---|---|---|---|
url | string | yes | The link, ending in ?sid=.... Use it exactly as returned. |
expires_at | string | yes | When the link stops working: 15 minutes after it was created (UTC). |
Refusals
| Status | Code | When |
|---|---|---|
| 400 | invalid_json | The request body is not valid JSON. |
| 400 | body_not_object | The request body is valid JSON but is not an object: for example a bare number, null or a list. |
| 400 | unsupported_charset | The request body is not in UTF-8. |
| 400 | unsupported_encoding | The request body is compressed in a way we do not read (Content-Encoding). |
| 400 | campaign_required | campaign_id is missing. |
| 400 | no_sessions | This campaign is a kind of page that takes no session links and no visits. |
| 401 | key_missing | 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. |
| 401 | key_invalid | The key is not one we know: mistyped, cut short, in the wrong form, or a key from another deployment. |
| 401 | key_revoked | The key was switched off, or its connection was switched off. |
| 401 | key_expired | The key was replaced and its 7 days have passed. |
| 401 | business_off | The business has been switched off on the platform, so none of its connections work for now. The key itself is not at fault. |
| 403 | scope_denied | The connection's purpose does not cover this endpoint (for example a connection that only creates links tried to record a visit). |
| 404 | campaign_not_found | The business has no campaign with this id. Another business's campaign answers the same way, on purpose. |
| 409 | campaign_archived | The business has archived this campaign. |
| 409 | campaign_not_available | The campaign exists but is not taking customers at the moment. |
| 413 | payload_too_large | The request body is far larger than any request here needs to be. |
| 429 | rate_limited | Too many calls in the last minute. |
| 500 | error | Something failed on our side. |
| 503 | busy | The service is busy for a moment. |
POST /api/v1/visits
Record a visit. Records a visit for a customer you identify by phone number or email address, as if staff had logged it on the business's dashboard: the same rewards and the same limits. The answer only says that the call was accepted, with a receipt id; it never says what the customer earned. The visit is timed when we receive it - a time you send is not read. Within 90 days, sending the same request_id again on the same connection returns the first call's receipt and records nothing. The order is: the key is accepted; the connection has the "Records visits" purpose and is within its limit (otherwise scope_denied or rate_limited); campaign_id and request_id are present and well formed; then a repeat gets the first call's receipt, before the campaign, the customer's details, the bill amount or the branch are looked at, so it holds whatever the rest of the repeat's body says and even if the campaign has since been archived. After 90 days the id is forgotten: the request is checked like a new one and gets a new receipt id. If the earlier request recorded a visit, no second visit or reward is recorded. If the earlier request only joined a visit already in progress, the repeat (once that visit's window has closed) is recorded as a new visit and can give a reward. On a "play first, then identify" campaign the wait between visits 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.
Purpose needed: Records visits. Limit: 120 calls a minute for each connection.
Request fields
| Field | Type | Required | Meaning |
|---|---|---|---|
campaign_id | string | yes | A campaign of the key's business, from the campaign list. |
request_id | string | yes | Your own id for this visit - the bill or order number. 1 to 64 visible ASCII characters, no spaces. Never a phone number or an email address. Remembered for 90 days per connection. |
phone | string | no | The customer's phone number, in the format of the business's country: a Nepal business takes 10 digits, optionally preceded by +977 or 977. A full international number (+ and the calling code) is also accepted. Spaces and dashes are ignored. It is stored with its calling code. |
email | string | no | The customer's email address. If you send both a phone number and an email address and they belong to two different customers, the phone number decides. |
name | string | no | The customer's name. Optional. Stored only when the campaign's form collects a name; otherwise it is accepted and left out. |
txn_value | number or string | no | The bill amount, in the business's currency. Optional. Send a number of zero or more; plain text that is such a number, like "12.5", is read too. Anything else (for example "1,200.00", a negative number, or a number too large to be exact, above 9007199254740991) is ignored: the call goes ahead as if no amount was sent. |
branch | string | no | Your own code for the branch. Optional. A code we do not recognise is ignored. |
Answer (200)
| Field | Type | Always there | Meaning |
|---|---|---|---|
accepted | boolean | yes | Always true: the visit was received. |
event_id | string | yes | A receipt id for this call. Keep it for support questions. It is NOT the event_id of the visit.recorded webhook. |
Refusals
| Status | Code | When |
|---|---|---|
| 400 | invalid_json | The request body is not valid JSON. |
| 400 | body_not_object | The request body is valid JSON but is not an object: for example a bare number, null or a list. |
| 400 | unsupported_charset | The request body is not in UTF-8. |
| 400 | unsupported_encoding | The request body is compressed in a way we do not read (Content-Encoding). |
| 400 | campaign_required | campaign_id is missing. |
| 400 | request_id_required | request_id is missing. |
| 400 | request_id_invalid | request_id must be 1 to 64 visible ASCII characters with no spaces. |
| 400 | no_sessions | This campaign is a kind of page that takes no session links and no visits. |
| 400 | wrong_flow | This campaign is set up in a way that cannot take a visit recorded for it. |
| 400 | identifier_required | The campaign needs a phone number or an email address and the call carried none it can use. field names what to send. |
| 400 | invalid_phone | 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). |
| 400 | invalid_email | The email address is not valid. |
| 401 | key_missing | 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. |
| 401 | key_invalid | The key is not one we know: mistyped, cut short, in the wrong form, or a key from another deployment. |
| 401 | key_revoked | The key was switched off, or its connection was switched off. |
| 401 | key_expired | The key was replaced and its 7 days have passed. |
| 401 | business_off | The business has been switched off on the platform, so none of its connections work for now. The key itself is not at fault. |
| 403 | scope_denied | The connection's purpose does not cover this endpoint (for example a connection that only creates links tried to record a visit). |
| 404 | campaign_not_found | The business has no campaign with this id. Another business's campaign answers the same way, on purpose. |
| 409 | campaign_archived | The business has archived this campaign. |
| 409 | campaign_not_available | The campaign exists but is not taking customers at the moment. |
| 413 | payload_too_large | The request body is far larger than any request here needs to be. |
| 429 | rate_limited | Too many calls in the last minute. |
| 500 | error | Something failed on our side. |
| 503 | busy | The service is busy for a moment. |
Examples
Each example below is run against the platform by our own tests every time the platform changes, so it cannot go out of date. Values that differ on every call (the link, the times, the receipt ids) are samples.
Example: List the business's campaigns
Request
GET /api/v1/campaigns
Authorization: Bearer cpk_3f9a1c2b4d5e_<secret>Answer
HTTP 200
{
"campaigns": [
{
"campaign_id": "cmp_example",
"name": "Acme Cafe",
"identifiers": [
"phone"
]
}
]
}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.
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.
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"
}
}Example: A connection that only creates links tries to record a visit
Request
POST /api/v1/visits
Authorization: Bearer cpk_7a0b9c8d1e2f_<secret>
Content-Type: application/json
{
"campaign_id": "cmp_example",
"request_id": "BILL-10484",
"phone": "9801234567"
}Answer
HTTP 403
{
"error": {
"code": "scope_denied",
"message": "This connection is not set up for this kind of request."
}
}Example: A key we do not know
Request
GET /api/v1/campaigns
Authorization: Bearer cpk_000000000000_0000000000000000000000000000000000000000000000000000000000000000Answer
HTTP 401
{
"error": {
"code": "key_invalid",
"message": "This key is not recognised."
}
}Sending a visit twice
request_id makes a visit safe to send again. The first call with a given request_id on a connection decides the outcome; for 90 days, every later call with the same request_id that passes the first checks listed below returns the same receipt and records nothing, even if the rest of the request is different.
- Use one
request_idper bill, and the same one for every retry of that bill. - Within 90 days, a repeat gets the first call's receipt. The order is: the key is accepted; the connection has the Records visits purpose and is within its limit (otherwise the answer is
scope_deniedorrate_limited);campaign_idandrequest_idare present and well formed; then a repeat gets the first call's receipt. That happens before the campaign, the customer's details, the bill amount or the branch are looked at, so it holds even if the campaign has since been archived, and whatever the rest of the repeat's body says. A bill amount or branch we ignore on a repeat is not noted again. - After 90 days the
request_idis forgotten. The request is then checked like a new one and gets a new receipt id. If the earlier request recorded a visit, no second visit and no second reward is recorded. If it 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. - Two connections may use the same
request_idwithout clashing. - A refused call (any error answer) is not remembered: correct it and send it again with the same
request_id.
Errors
Every answer that is not a success is { "error": { "code", "message", "field" } }. field is present only when the refusal is about one field. Decide from code.
| 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
Counted per connection, per minute. Over the limit: 429, code rate_limited, and a Retry-After header with the 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 |