# Attachments

Typically the POS uploads an electronic receipt after the payment has been confirmed. By the Merchant Agreement, the Merchant is required to provide information of the purchase to the user. This is done by uploading either Receipts or ItemLists to an attachment URI.

# How to upload (opens new window)

Attachment URIs are generated by Settle and are given in the attachment_uri field in the JSON response on certain endpoint. At the moment only the outcome (opens new window) endpoint for payment request exposes such a field. When an attachment URI has been acquired, any number of files can be uploaded by making a POST request formatted as multipart/form-data. This format is described in RFC 2388 (opens new window). However, libraries that are able to make multipart/form-data HTTP requests are readily available for most programming languages.

Note that each upload is "all or nothing". This means that if one or more files fails in a multi-file upload (e.g. due to failed server-side format validation), the entire upload will be discarded by Settle.

# Supported mime-types (opens new window)

The uploaded data is validated according to the Content-Type of the part in the request.

The supported MIME-types and their respective schemas are:

    • 'application/vnd.mcash.itemlist.v1+json'

        • Settle item lists. Will be rendered for the user in the Settle app.
        • store_name : String : optional : default=null Information about the Store
          organization_number : String : optional : default=null Organization number, e.g. "123456789MVA"
          items[] : Item (opens new window) : optional : default=null Items
    • 'application/vnd.mcash.receipt.v1+json'

      • cashier : String : optional : default=null Seller ID or seller name
        register : String : optional : default=null Cash register/POS identifier
        store : Store (opens new window) : optional : default=null Information about the Store
        items[] : ReceiptItem (opens new window) : optional : default=null Items
        payments[] : ReceiptPayment (opens new window) : optional : default=null Payments
        currency : String : optional : default=null The currency of amounts on this receipt
        gross : String : optional : default=null Gross amount before discounts
        discount : String : optional : default=null Discount on the gross
        net : String : optional : default=null gross - discount
    • 'image/png'

      No schema, only size restriction of 1 MB.