Invoice

Allows the uploading of invoices to return a Zapper Code, and the resetting of active invoices.

put
Upload Invoice

http://zapperhub/api/v1/invoice/:reference
This endpoint allows you to upload an invoice to the Zapper Hub and receive a Zapper Code in order to facilitate Zapper payments and value-added services.
Request
Response
Path Parameters
reference
required
string
The merchant invoice reference
Headers
Accept
required
string
The data type to be returned. Accepted types are: text/plain application/json image/png
Content-Type
required
string
application/json
Body Parameters
siteReference
required
string
The identifier for 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. Max length of 3 characters
amount
required
number
The invoice amount in cents
lineItems
required
array
A list of line items; see below
origin
required
string
The provider of the invoice. eg, gaap, micros, shopify, etc
createdUTCDate
required
string
The date of the invoice creation
originReference
optional
string
A unique reference code from the provider
200: OK
Invoice successfully uploaded.
// Accept: application/json
{
"reference": "zapper_reference_1234",
"amount": 5030,
"base64Code": "dGhpcyB3aWxsIGJlIHRoZSBxciBjb2RlIGNvbnR...="
}
// Accept: text/plain
// The base64 encoded Zapper Code string
dGhpcyB3aWxsIGJlIHRoZSBxciBjb2RlIGNvbnR...=
// Accept: image/png
// The png data
PNG\r\n\u001a\n\u0000\u0000\u0000\rIH...=
400: Bad Request
Bad request
Bad request
406: Not Acceptable
Not acceptable
500: Internal Server Error
General system failure
Internal server error
503: Service Unavailable
Lost connection to Zapper
Payments unavailable

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 are not unique to a single invoice.

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

LineItem

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
Invoice Reset

http://zapperhub/api/v1/invoice/:reference
Once the invoice has been settled, call this endpoint to remove it from the active invoices.
Request
Response
Path Parameters
reference
required
string
The reference for an active invoice
200: OK

All text fields default to a length of 50 characters unless otherwise specified