POST
https://jmpy.me/api/v1
/
qr-ab-tests
curl -X POST https://jmpy.me/api/v1/qr-ab-tests \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Menu Layout Test",
    "description": "Testing new vs old menu PDF",
    "primary_qr_id": "qr_123456789",
    "traffic_split_mode": "equal",
    "variants": [
      {
        "name": "Original Menu",
        "destination_url": "https://restaurant.com/menu-v1",
        "traffic_weight": 50
      },
      {
        "name": "New Menu",
        "destination_url": "https://restaurant.com/menu-v2",
        "traffic_weight": 50
      }
    ]
  }'
{
  "test": {
    "id": "test_987654321",
    "user_id": "usr_55555",
    "name": "Menu Layout Test",
    "description": "Testing new vs old menu PDF",
    "primary_qr_id": "qr_123456789",
    "traffic_split_mode": "equal",
    "min_sample_size": 100,
    "confidence_level": 95,
    "status": "draft",
    "created_at": "2024-03-20T10:00:00Z",
    "variants": [
      {
        "id": "var_1",
        "test_id": "test_987654321",
        "name": "Original Menu",
        "destination_url": "https://restaurant.com/menu-v1",
        "traffic_weight": 50
      },
      {
        "id": "var_2",
        "test_id": "test_987654321",
        "name": "New Menu",
        "destination_url": "https://restaurant.com/menu-v2",
        "traffic_weight": 50
      }
    ]
  },
  "message": "QR A/B test created successfully"
}
Create a new A/B test to optimize QR code performance by splitting traffic between multiple destination URLs or designs.

Body Parameters

name
string
required
The name of the A/B test.
primary_qr_id
string
required
The UUID of the primary QR code to test. You can retrieve this from the List QR Codes endpoint.
variants
object[]
required
Array of variant configurations. At least 2 variants are required.
variants[].name
string
Name of the variant (e.g., “Control”, “Design B”).
variants[].destination_url
string
required
The destination URL for this variant.
variants[].traffic_weight
number
default:"50"
Percentage of traffic to route to this variant. Must sum to 100 if traffic_split_mode is ‘weighted’.
description
string
Optional description for the test.
traffic_split_mode
string
default:"equal"
How traffic is split. One of equal or weighted.
min_sample_size
number
default:"100"
Minimum number of scans required before statistical significance is calculated.
confidence_level
number
default:"95"
Target confidence level percentage (e.g., 90, 95, 99).

Request Examples

curl -X POST https://jmpy.me/api/v1/qr-ab-tests \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Menu Layout Test",
    "description": "Testing new vs old menu PDF",
    "primary_qr_id": "qr_123456789",
    "traffic_split_mode": "equal",
    "variants": [
      {
        "name": "Original Menu",
        "destination_url": "https://restaurant.com/menu-v1",
        "traffic_weight": 50
      },
      {
        "name": "New Menu",
        "destination_url": "https://restaurant.com/menu-v2",
        "traffic_weight": 50
      }
    ]
  }'
{
  "test": {
    "id": "test_987654321",
    "user_id": "usr_55555",
    "name": "Menu Layout Test",
    "description": "Testing new vs old menu PDF",
    "primary_qr_id": "qr_123456789",
    "traffic_split_mode": "equal",
    "min_sample_size": 100,
    "confidence_level": 95,
    "status": "draft",
    "created_at": "2024-03-20T10:00:00Z",
    "variants": [
      {
        "id": "var_1",
        "test_id": "test_987654321",
        "name": "Original Menu",
        "destination_url": "https://restaurant.com/menu-v1",
        "traffic_weight": 50
      },
      {
        "id": "var_2",
        "test_id": "test_987654321",
        "name": "New Menu",
        "destination_url": "https://restaurant.com/menu-v2",
        "traffic_weight": 50
      }
    ]
  },
  "message": "QR A/B test created successfully"
}
Create a new A/B test to optimize QR code performance by splitting traffic between multiple destination URLs or designs.

Body Parameters

name
string
required
The name of the A/B test.
primary_qr_id
string
required
The UUID of the primary QR code to test.
variants
object[]
required
Array of variant configurations. At least 2 variants are required.
variants[].name
string
Name of the variant (e.g., “Control”, “Design B”).
variants[].destination_url
string
required
The destination URL for this variant.
variants[].traffic_weight
number
default:"50"
Percentage of traffic to route to this variant. Must sum to 100 if traffic_split_mode is ‘weighted’.
description
string
Optional description for the test.
traffic_split_mode
string
default:"equal"
How traffic is split. One of equal or weighted.
min_sample_size
number
default:"100"
Minimum number of scans required before statistical significance is calculated.
confidence_level
number
default:"95"
Target confidence level percentage (e.g., 90, 95, 99).
curl -X POST https://jmpy.me/api/v1/qr-ab-tests \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Menu Layout Test",
    "description": "Testing new vs old menu PDF",
    "primary_qr_id": "qr_123456789",
    "traffic_split_mode": "equal",
    "variants": [
      {
        "name": "Original Menu",
        "destination_url": "https://restaurant.com/menu-v1",
        "traffic_weight": 50
      },
      {
        "name": "New Menu",
        "destination_url": "https://restaurant.com/menu-v2",
        "traffic_weight": 50
      }
    ]
  }'
{
  "test": {
    "id": "test_987654321",
    "user_id": "usr_55555",
    "name": "Menu Layout Test",
    "description": "Testing new vs old menu PDF",
    "primary_qr_id": "qr_123456789",
    "traffic_split_mode": "equal",
    "min_sample_size": 100,
    "confidence_level": 95,
    "status": "draft",
    "created_at": "2024-03-20T10:00:00Z",
    "variants": [
      {
        "id": "var_1",
        "test_id": "test_987654321",
        "name": "Original Menu",
        "destination_url": "https://restaurant.com/menu-v1",
        "traffic_weight": 50
      },
      {
        "id": "var_2",
        "test_id": "test_987654321",
        "name": "New Menu",
        "destination_url": "https://restaurant.com/menu-v2",
        "traffic_weight": 50
      }
    ]
  },
  "message": "QR A/B test created successfully"
}