My Product Cares
BlogSchedule a callContact us
  • Overview
  • Frontend Page
    • Prefill form fields
    • Registered entries
  • Claim Warranty
  • App Admin
    • Forms
      • Listing
        • Registration detail
      • Form Design
      • Form Settings
        • Limit product search to specific products
      • Claim Warranty Form
    • App Settings
      • General Settings
      • Custom From Email
      • Serial Numbers
        • Serial number with file download
    • Email Templates
    • Warranty
    • Navigation
    • Customer Admin Link
    • Registrations In Account Area
    • Form inside Shopify Page
    • Add registrations for customer
  • POS (Point Of Sales)
  • Integrations
    • Klaviyo
    • Stripe payment
  • Video tutorials
  • Advance
    • API
    • Import/Migrate Registrations
    • Webhook
    • Downloadable assets after submit
    • Serial number checker/validator
    • Shopify Flow
  • Frequently Asked Questions (FAQ)
    • Why is View on the frontend link not working?
  • Migrate to v2
  • Change Logs
  • Contact us
  • Terms & Conditions
  • Privacy Policy and Data Protection
Powered by GitBook
On this page
  • Generate Access Token
  • Usage
  • Registrations - add new (POST)
  • Registrations - Modify existing registration (PUT)
  • Registrations - Get customer's registrations
  • Serial Numbers
  • Get a unused/unregistered serial number (GET)
  • Get a serial number (GET)
  1. Advance

API

If you ever need to add registrations or serial numbers programmatically, there is an API for it.

The access token can either put in the Authorization header or in the body

Generate Access Token

Access token can be obtain in the Shopify Admin > Apps > My Product Registration > Settings > General > API Access token > Generate

Usage

Registrations - add new (POST)

Once the access token is generated, it can be use to register a new product

  1. Make an HTTP POST request to the endpoint - https://product-reg.varify.xyz/api/registrations

  2. The POST request should have the following JSON payload

{
    "accessToken": "12323213123",
    "registrations": [
        {
            "productName": "MacBook 2018",
            "customerEmail": "tom@example.com",
            "customerName": "Tom Delong",
            "serialNumbers": [
                "123",
                "321"
            ],
            "purchaseDate": "2019-01-01",
            "greetings": "hello world!",
        }
    ]
}

It's possible to register multiple products in one call - simply add another registration object to the registrations array.

If need to add data to different form e.g not the default product-registration, a new key will needed add to the registration "type": "form-slug-name", then form slug name can be found in the Form > View on frontend

If there are extra fields just add those field as key within registration, the key name can be found in the form's design and field options

Registrations - Modify existing registration (PUT)

Once the access token is generated, it can be used to modify existing registration (the registration id can be found in the admin or via the webhook payload)

  1. Make a HTTP PUT request to the endpoint - https://product-reg.varify.xyz/api/registrations/:regId

  2. The PUT request should have the following JSON payload

{
    "accessToken": "12323213123",
    "registration": {
            "productName": "MacBook 2018",
            "customerEmail": "tom@example.com",
            "customerName": "Tom Delong",
            "serialNumbers": [
                "123",
                "321"
            ],
            "purchaseDate": "2019-01-01",
            "fields": {
                "greetings": "hello agaiin",
            }
    }
}

If there are extra fields need to update, then put it under fields key

Registrations - Get customer's registrations

  1. make a HTTP GET request to the endpoint /api/registrations?email=tom@example.com, the email must be in the query string

  2. It will return all customer's registrations

Serial Numbers

Here is example the payload for adding serial numbers (POST)

  1. Make a HTTP POST request to the endpoint /api/serial_numbers

  2. The POST request should have the following JSON payload

{
    "accessToken": "12323213123",
    "serialNumbers": [
        {
            "serialNumber": "22018",
            "sku": "mac123",
            "customerTags": "VIP,mac",
        }
    }

The customerTags is a comma-separated of tags you want to tag the customer who register this serial number

Get a unused/unregistered serial number (GET)

You can get a random unregistered serial number

  1. Make a HTTP GET request to the endpoint /api/serial_number

  2. It will return a random unregistered serial number if there is one with status 200

  3. If there is no unregistered seiral number, it wil return 204

Get a serial number (GET)

Getting information of a serial number

  1. make a HTTP GET request to the endpoint /api/serial_numbers/test123, test123 is a serial number

  2. It will return the serial number info if there is one

  3. if there is no such serial number, it will return 204

PreviousStripe paymentNextImport/Migrate Registrations