Invoices

post
Upload invoice

https://api.zapper.com/business/api/v1/merchants/{merchantId}/sites/{siteId}/invoices
This endpoint allows you to upload an invoice to the Zapper Platform and receive a Zapper Code for that invoice. Customers can use this code to scan and make Zapper payments to you. The siteReference parameter will be returned in Payment Notifications, allowing you to match uploaded invoices to payments.
Request
Response
Request
Headers
Representation-Type
optional
string
The representation-type to be returned. See Representation-Types below. Defaults to "triggercode/transient"
Content-Type
required
string
application/json
Accept
required
string
The data-type to be returned. Accepted types are: text/plain application/json image/svg+xml
Authorization
required
string
Bearer <integration authentication token>
Body Parameters
externalReference
optional
string
A merchant's reference for an invoice
siteReference
required
string
The identifier of the point of sale till. This is required for routing of Zapper payments and invoices.
currencyISOCode
required
string
The currency ISO code of the invoice.
amount
required
number
The invoice amount in cents.
lineItems
optional
array
A list of line items. See the model below.
origin
required
string
The provider of the invoice.
createdUTCDate
required
string
The date of the invoice creation.
originReference
optional
string
A unique reference code from the provider
Response
200: OK
Invoice successfully uploaded.
// Request Header - Accept: application/json
{
"siteReference": "site_reference_1",
"currencyISOCode": "ZAR",
"amount": 1500,
"lineItems": [
{
"name": "coke",
"productCode": "ck",
"SKU": "coke1",
"unitPrice": 500,
"categories": [],
"quantity": 1
},
{
"name": "fanta",
"productCode": "fn",
"SKU": "fnta1",
"unitPrice": 500,
"categories": [],
"quantity": 2
}
],
"origin": "micros",
"createdUTCDate": "2019-02-15T13:30:48.9070611Z",
"originReference": "micros_129473",
"reference": "522ccadc-779b-475f-b87a-5410c0c43c3c",
"state": "open"
}
// Request Header - Accept: text/plain
// The Code string (to be used to create a QR Code) e.g:
https://zapper.com/lc?tcv=0260E041...
// Request Header - Accept: image/svg+xml
// Returns the Code as an SVG QR Code
// Request Header - Representation-Type: deeplink/zappercode/v2
// This Representation-Type always returns a string
// Returns the deeplink (string) e.g:
https://zapper.com/payWithZapper?qr=http...
400: Bad Request
Validation failed; Client error
bad reqeust
500: Internal Server Error
Server side errors;
internal server error

The upload invoice endpoint will return a "reference" response header which is used to identify the invoice in subsequent requests.

This is useful in scenarios where an image is returned instead of the invoice response model.

Invoices sent by merchants are typically short-lived, and are expected to be recycled various times throughout a business day. This often means that invoice references used by a business are not unique to a single invoice.

The default representation will only be active for 1 hour.

In the event that your business recycles invoices and communicates recycled invoice references to the Zapper Platform, payment notifications returned may vary.

LineItem

Line-items can be included in your invoices, allowing you to take advantage of Zapper's itemised vouchers and better promote specific items.

Product code or stock keeping unit (SKU) is required

Field

Datatype

Required

Description

name

string

No

The friendly name of the line item

productCode

string

Conditional

The product identifier

SKU

string

Conditional

The stock keeping unit code

unitPrice

number

Yes

The price for a single unit in cents

categories

array<string>

No

A list of names or codes used to group items

quantity

number

No

The number of items, defaults to 1 if not supplied

delete
Close Invoice by Zapper's reference

https://api.zapper.com/business/api/v1/merchants/{merchantId}/sites/{siteId}/invoices/{reference}
This endpoint allows you to close an open invoice on the Zapper Platform using the Zapper reference for the invoice. To ensure your customers receive the Zapper Code that is relevant to their payment, it is important that previous invoices are closed off once payments for those invoices has been received.
Request
Response
Request
Path Parameters
reference
required
string
Zapper's unique reference to an invoice
Headers
Authorization
required
string
Bearer <integration authentication token>
Response
200: OK
Invoice closed successfully.
success

delete
Close Invoice by Merchant's reference

https://api.zapper.com/business/api/v1/merchants/{merchantId}/sites/{siteId}/invoices
This endpoint allows you to close an open invoice on the Zapper Platform using the external reference for the invoice. To ensure your customers receive the Zapper Code that is relevant to their payment, it is important that previous invoices are closed off once payments for those invoices has been received.
Request
Response
Request
Headers
Authorization
required
string
Bearer <integration authentication token>
Query Parameters
externalReference
required
string
The merchant's reference for an invoice
Response
200: OK

Representations

Representation-Types

Representation-Type

Description

Limitations

Category

zappercode/v2

A legacy Invoice Representation which includes the merchant Info, invoice amount and other metadata such as instructions to enable/disable certain client features (e.g. show tip and split bill options)

  • Does not support line items

QR Code

zappercode/v6

Similar to v2 in that the code includes some of the invoice information within it, however, the invoice details are encoded and compressed which allows the inclusion of line-items (facilitating line-item voucher support)

  • Can grow into a dense QR Code which may be difficult to scan with low end cameras.

QR Code

triggercode/transient

A short string with only an identifier to a backing value on server side, i.e. No other information is stored within the code. QR Codes are less dense and easier to scan as a result. Ideal for use in restaurants when a code of limited length is printed onto a bill

  • Fetches Invoice from Zapper server before displaying to user

  • Only active for 1 hour

QR Code

triggercode/dynamic

A physical printed code with only an identifier to a backing value. This code is pre-provisioned on a stand and provided to the merchant. The merchant can then assign the code to a specific site/till.

Invoice uploads will automatically update/clear the server side backing value. This is ideal for retail scenarios where physical codes are set up on the counters at each till.

  • Fetches Invoice from Zapper server before displaying to user

QR Code

deeplink/zappercode/v2

A special shareable link including a v2 Zapper Code that when clicked, takes the user to the pay screen of the Zapper App

  • Some older devices do not link directly through to app

  • Does not support line items.

Link

deeplink/zappercode/v6

A special shareable link including a v6 Zapper Code that when clicked, takes the user to the pay screen of the Zapper App

  • Some older devices do not link directly through to app

Link

________________________

Supported Accept Headers For Representation Categories

If the Accept header is set to "application/json", the Representation-Type header is ignored

If the Accept header is set as "text/plain", but the caller requires a QR Code, either generate the QR Code from the string that is returned or change the accept header to "image/svg+xml" or "image/png" to have the QR Code generated by the invoice service.

For Representations categorized as "Link", only the text/plain header is supported.

Representation Category

Supported Accept Headers

QR Code

  • Accept: text/plain

  • Accept: image/svg+xml

  • Accept: image/png

Link

  • Accept: text/plain