Quickstart: Downloading attachments

You want to export receipts and invoices attached to payments to your application.

The scenario you want to achieve

  1. The bunq user has accepted the authorization request and your application can read the bunq user’s account information.

  2. Your application imports all the transactions and attachments.

  3. The bunq user sees the transactions matched with the receipts and invoices in your application.

Before you start

Call sequence

List the payments of the user

GET https://public-api.sandbox.bunq.com/v1/user/{userID}/monetary-account/{monetary-accountID}/payment

Path Parameters

Name
Type
Description

userID

integer

The ID of the user.

monetary-accountID *

integer

The ID of the monetary account.

Headers

Name
Type
Description

User-Agent

string

Information about the user agent originating the request. There are no restrictions on the value of this header.

X-Bunq-Client-Authentication *

string

The token you get in the response of the session-server call.

[
  {
    "id": 0,
    "created": "string",
    "updated": "string",
    "monetary_account_id": 0,
    "amount": {
      "value": "string",
      "currency": "string"
    },
    "alias": {
      "iban": "string",
      "display_name": "string",
      "avatar": {
        "uuid": "string",
        "anchor_uuid": "string",
        "image": [
          {
            "attachment_public_uuid": "string",
            "content_type": "string",
            "height": 0,
            "width": 0
          }
        ]
      },
      "label_user": {
        "uuid": "string",
        "display_name": "string",
        "country": "string",
        "avatar": {
          "uuid": "string",
          "anchor_uuid": "string",
          "image": [
            {
              "attachment_public_uuid": "string",
              "content_type": "string",
              "height": 0,
              "width": 0
            }
          ]
        },
        "public_nick_name": "string"
      },
      "country": "string",
      "bunq_me": {
        "type": "string",
        "value": "string",
        "name": "string"
      },
      "is_light": true,
      "swift_bic": "string",
      "swift_account_number": "string",
      "transferwise_account_number": "string",
      "transferwise_bank_code": "string",
      "merchant_category_code": "string"
    },
    "counterparty_alias": {
      "iban": "string",
      "display_name": "string",
      "avatar": {
        "uuid": "string",
        "anchor_uuid": "string",
        "image": [
          {
            "attachment_public_uuid": "string",
            "content_type": "string",
            "height": 0,
            "width": 0
          }
        ]
      },
      "label_user": {
        "uuid": "string",
        "display_name": "string",
        "country": "string",
        "avatar": {
          "uuid": "string",
          "anchor_uuid": "string",
          "image": [
            {
              "attachment_public_uuid": "string",
              "content_type": "string",
              "height": 0,
              "width": 0
            }
          ]
        },
        "public_nick_name": "string"
      },
      "country": "string",
      "bunq_me": {
        "type": "string",
        "value": "string",
        "name": "string"
      },
      "is_light": true,
      "swift_bic": "string",
      "swift_account_number": "string",
      "transferwise_account_number": "string",
      "transferwise_bank_code": "string",
      "merchant_category_code": "string"
    },
    "description": "string",
    "type": "string",
    "sub_type": "string",
    "bunqto_status": "string",
    "bunqto_sub_status": "string",
    "bunqto_share_url": "string",
    "bunqto_expiry": "string",
    "bunqto_time_responded": "string",
    "attachment": [
      {
        "id": 0,
        "monetary_account_id": 0
      }
    ],
    "merchant_reference": "string",
    "batch_id": 0,
    "scheduled_id": 0,
    "address_shipping": {
      "street": "string",
      "house_number": "string",
      "po_box": "string",
      "postal_code": "string",
      "city": "string",
      "country": "string",
      "extra": "string",
      "mailbox_name": "string",
      "province": "string"
    },
    "address_billing": {
      "street": "string",
      "house_number": "string",
      "po_box": "string",
      "postal_code": "string",
      "city": "string",
      "country": "string",
      "extra": "string",
      "mailbox_name": "string",
      "province": "string"
    },
    "geolocation": {
      "latitude": 0,
      "longitude": 0,
      "altitude": 0,
      "radius": 0
    },
    "request_reference_split_the_bill": [
      {
        "type": "string",
        "id": 0
      }
    ],
    "balance_after_mutation": {
      "value": "string",
      "currency": "string"
    }
  }
]

Check if the payments have attachments

GET https://public-api.sandbox.bunq.com/v1/user/{userID}/monetary-account/{monetary-accountID}/payment/{paymentID}/note-attachment

Path Parameters

Name
Type
Description

userID

integer

The ID of the user.

monetary-accountID *

integer

The ID of the monetary account.

paymentID

integer

The ID of the payment

Headers

Name
Type
Description

User-Agent

string

Information about the user agent originating the request. There are no restrictions on the value of this header.

X-Bunq-Client-Authentication *

string

The token you get in the response of the session-server call.

[
  {
    "id": 0,
    "created": "string",
    "updated": "string",
    "label_user_creator": {
      "uuid": "string",
      "display_name": "string",
      "country": "string",
      "avatar": {
        "uuid": "string",
        "anchor_uuid": "string",
        "image": [
          {
            "attachment_public_uuid": "string",
            "content_type": "string",
            "height": 0,
            "width": 0
          }
        ]
      },
      "public_nick_name": "string"
    },
    "description": "string",
    "attachment": [
      {
        "id": 0,
        "monetary_account_id": 0
      }
    ]
  }
]

Save the attachment IDs.

Export the raw content of the attachments

GET https://public-api.sandbox.bunq.com/v1/user/{userID}/attachment/{attachmentID}/content

Path Parameters

Name
Type
Description

userID

integer

The ID of the user.

attachmentID

integer

The ID of the attachment.

Headers

Name
Type
Description

User-Agent

string

Information about the user agent originating the request. There are no restrictions on the value of this header.

X-Bunq-Client-Authentication *

string

The token you get in the response of the session-server call.

[
  {}
]

You can use callbacks to make sure you don’t miss anything happening on the bunq account.

Last updated