Decode

This endpoint allows for the decoding of a Zapper-supported QR code to retrieve an invoice.

Identifying Zapper-supported QR Codes

Zapper-supported QR codes include Zapper's proprietary QR codes, as well as various third-party provider codes:

In order to determine if a QR code is supported by Zapper, it should be sent for decoding so that the value can be verified against the regex below:

^((.*zapper\.com.*)|(.*\.wigroup\..*)|(.{2}\/.{4}\/.{20})|(.*payat\.io.*)|(.*(paynow\.netcash|paynow\.sagepay)\.co\.za.*)|(SK\-\d{1,}\-\d{23})|(\d{20})|(.*\d+\.zap\.pe(.*\n?)*)|(.*transactionjunction\.co\.za.*)|(CRSTPC-\d+-\d+-\d+-\d+-\d+))$

The code should be trimmed before performing the regex match.

Decode Zapper Code

GET https://api.zapper.com/v1/codes/{code}

Retrieve an existing invoice for the provided Zapper supported code.

Path Parameters

NameTypeDescription

code

string

The base64 encoded value

Headers

NameTypeDescription

Authorization

String

Bearer <Identity Token> The identity token received from the service account login

x-api-key

string

Authentication key

{
    "merchant": {
        "merchantReference": "merchant_reference",
        "merchantName": "Merchant",
        "currencyISO": "ZAR",
        "currencySymbol": "R",
        "features": {
            "amount": {
                "editable": true
            },
            "orderReference": {
                "label": "Reference",
                "editable": false,
                "required": false
            },
            "tip": {
                "enabled": false
            }
        }
    },
    "invoice": {
        "siteReference": "site_reference",
        "currencyISOCode": "ZAR",
        "amount": 1000,
        "lineItems": [
            {
                "name": "item1",
                "productCode": "it1",
                "sku": "item1",
                "unitPrice": 500,
                "categories": [],
                "quantity": 0
            },
            {
                "name": "item2",
                "productCode": "it2",
                "sku": "item2",
                "unitPrice": 500,
                "categories": [],
                "quantity": 500
            }
        ],
        "createdUTCDate": "0001-01-01T00:00:00.000Z",
        "origin": "pos",
        "originReference": "pos-1",
        "invoiceReference": "00000000-0000-0000-0000-000000000000",
        "orderReference": "00000000-0000-0000-0000-000000000000",
        "state": "open"
    }
}

Response

All fields are required unless indicated as optional.

Field

Type

Description

merchant

object

The merchant information.

invoice

object

The details of the invoice.

Merchant

Field

Type

Description

merchantReference

string

The merchant's unique reference.

merchantName

string

The name of the merchant.

currencyISOCode

string

The merchant's three-character ISO 4217 currency symbol.

currencySymbol

string

The currency display symbol.

features

object

Payment feature configuration.

Invoice

Field

Type

Description

siteReference

string

The identifier of the point of sale till.

currencyISOCode

string

The invoiced three-character ISO 4217 currency code.

amount

number

The invoiced amount in cents.

lineItems

collection optional

A list of line items.

createdUTCDate

string

The date of the invoice creation.

format: yyyy-MM-ddTHH:mm:ss.fffZ.

origin

string

optional

The provider of the invoice.

originReference

string

optional

A unique reference code from the provider.

invoiceReference

string

optional

A unique reference for the invoice.

orderReference

string

optional

A unique reference for the invoice used during payment.

state

string

optional

The current state of the invoice.

Either "open" or "closed"

Line Items

Product code or stock keeping unit (SKU) is required.

Field

Type

Description

name

string optional

The friendly name of the line item.

productCode

string conditional

The product identifier.

sku

string conditional

The stock keeping unit code.

unitPrice

string

The price for a single unit in cents.

categories

collection optional

A list of names or codes used to group items.

quantity

number optional

The number of items, defaults to 1 if not supplied.

Features

Field

Type

Description

amount

object optional

Feature configuration for the amount field.

orderReference

object optional

Feature configuration for the orderReference.

tip

object optional

Feature configuration for tip.

Amount

Field

Type

Description

editable

bool

Can the amount be edited.

OrderReference

Field

Type

Description

label

string

Custom label set by the merchant.

editable

bool

Indicates if the reference is editable.

required

bool

Indicates if it is mandatory to send the orderReference during payment.

Tip

Field

Type

Description

enabled

bool

Indicates if a tip can be captured.

Last updated