QRdx
HelpGuidesDevelopersReact librarySelf-hosting

Report a conversion

Attributes a sale, sign-up or other conversion to the scan that brought the visitor (Business).

From your server, send an API key (or token) and the scan's sid, or the code id as code. From the browser, conversions.js sends sid with no key, for codes with conversion tracking turned on. An id, such as your order id, makes retries safe: a repeat returns 200 with duplicate: true. More in Tracking and conversions.

Scope: codes:write, for API keys and OAuth tokens alike (when you send a key or token).

POST
/conversions

Authorization

headerAuthorizationBearer <qrdx_ followed by 40 letters and digits>

An API key, sent as Authorization: Bearer qrdx_…. Create one in Settings → API keys & apps: it is shown once. A key acts on the workspace it was created in as its creator, with their current role there, and only within its scopes, the same scopes as OAuth (each operation names the one it needs). API keys.

Request Body

application/json
  1. body
sid?string

The qrdx_sid the short link appended to your page URL

Lengthlength <= 200
code?string

The code id, when no scan is known (key or token requests only)

Match^[A-Za-z0-9_-]{1,64}$
name?string

What happened, e.g. purchase or signup

Match^[\p{L}\p{N} _.:/-]+$
Length1 <= length <= 64
Default"conversion"
value?|

Amount, as a number or string with up to 2 decimals

currency?string

ISO 4217 code; USD when a value has none

Match^[A-Z]{3}$
id?string

Your id for it (order id, ...); repeats are ignored

Length1 <= length <= 128
metadata?

Up to 20 extra keys

Response Body

Already recorded (same id)

application/json
  1. response
id*string

Conversion id (derived from id when you send one)

codeId*string
scanId*|

The attributed scan, or null when reported by code id

duplicate*boolean

True when a conversion with the same id was already recorded (status 200)

Example Request
curl -X POST 'https://api.qrdx.dev/v1/conversions' \  -H 'Content-Type: application/json' \  -d '{  "sid": "eyJjIjoiY201Y29kZSIsInMiOiJjbTVzY2FuIn0.sig",  "name": "purchase",  "value": 49.9,  "currency": "EUR",  "id": "order_1042"}'
Example Response
{  "id": "cv_3f1c2a9d0b7e4f6a8c5d1e2f3a4b5c6d",  "codeId": "cm5code0spring0menu00001",  "scanId": "cm5scan0berlin0000000001",  "duplicate": true}

Last updated on