Invoices

Upload invoice

POST 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.

Headers

Request Body

// 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...

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.

LineItems

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

SubMerchant

Submerchant information is required for aggregator partners with their own merchants.

Location

Location information that must be submitted with the submerchant information

Close Invoice by Zapper's reference

DELETE 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.

Path Parameters

Headers

success

Close Invoice by Merchant's reference

DELETE 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.

Query Parameters

Headers

Representations

Representation-Types

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.

Last updated