# Schemas

Schemas used in requests/responses of our API:

## returnUrls

| Parameter | Type             | Description                                          | Constraints | Required             |
| :-------- | :--------------- | :--------------------------------------------------- | :---------- | :------------------- |
| success   | String(1...2000) | Return URL to use when the transaction succeeds.     |             | :white\_check\_mark: |
| cancelled | String(1...2000) | Return URL to use when the transaction is cancelled. |             | :white\_check\_mark: |
| expired   | String(1...2000) | Return URL to use when the transaction is expired.   |             | :white\_check\_mark: |
| failed    | String(1...2000) | Return URL to use when the transaction is failed.    |             | :white\_check\_mark: |

## amountChangeable

| Parameter | Type | Description                | Constraints                                             | Required |
| :-------- | :--- | :------------------------- | :------------------------------------------------------ | :------- |
| min       | Int  | The minimum of the amount. | Must be higher than 0.                                  |          |
| max       | Int  | The maximum of the amount. | Must be higher than the minimum and lower than 5000000. |          |

## action

| Parameter | Type                              | Description                                                                    | Constraints | Required |
| :-------- | :-------------------------------- | :----------------------------------------------------------------------------- | :---------- | :------- |
| qrcode    | [qrcode](schemas-2#qrcode) Object | Next action to be performed by merchant (or consumer) to complete the payment. |             |          |

## qrcode

| Parameter | Type   | Description                                                    | Constraints | Required |
| :-------- | :----- | :------------------------------------------------------------- | :---------- | :------- |
| id        | String | Identifier of the QR Code known by the iDEAL QR Backend of CM. |             |          |
| url       | String | URL of the iDEAL QR code image to be shown to your customer.   |             |          |

## payment

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Type",
    "h-2": "Description",
    "h-3": "Constraints",
    "h-4": "Required",
    "0-0": "payment",
    "0-1": "String(36)",
    "0-2": "Payment unique identifier.",
    "0-3": "",
    "0-4": ":white_check_mark:",
    "1-0": "transaction",
    "1-1": "String(36)",
    "1-2": "Transaction unique identifier.",
    "1-3": "",
    "1-4": ":white_check_mark:",
    "2-0": "idealTransactionId",
    "2-1": "String(16)",
    "2-2": "The 16-digit transaction ID within the iDEAL scheme as known by the  issuing bank. The value can have leading zeros.",
    "2-3": "",
    "2-4": ":white_check_mark:",
    "3-0": "status",
    "3-1": "String",
    "3-2": "`OPEN` - Payment has been created. This is the initial status.  \n`SUCCESS` - Payment successfully paid.  \n`CANCELLED` - Payment has been cancelled by your customers.  \n`EXPIRED` - Payment has not succeeded; expired.  \n`FAILURE` - Payment has not succeeded; unknown reason.",
    "3-3": "",
    "3-4": ":white_check_mark:",
    "4-0": "createdAt",
    "4-1": "String(RFC3339)",
    "4-2": "Creation time.",
    "4-3": "ISO 8601 date and time.",
    "4-4": ":white_check_mark:",
    "5-0": "amount",
    "5-1": "Int(1...99999999)",
    "5-2": "Integer representing the amount of the payment. Denomination in the smallest currency subunit (e.g. eurocents).",
    "5-3": "",
    "5-4": "",
    "6-0": "consumerName",
    "6-1": "String",
    "6-2": "Name of the customer that completed the payment.",
    "6-3": "Only present in successful payments.",
    "6-4": "",
    "7-0": "consumerBic",
    "7-1": "String(8...11)",
    "7-2": "Bank Identification Code used by the customer to complete the payment.",
    "7-3": "Only present in successful payments.",
    "7-4": "",
    "8-0": "consumerIban",
    "8-1": "String",
    "8-2": "IBAN used by the customer to complete the payment.",
    "8-3": "Only present in successful payments.",
    "8-4": ""
  },
  "cols": 5,
  "rows": 9,
  "align": [
    "left",
    "left",
    "left",
    "left",
    "left"
  ]
}
[/block]

## refund

| Parameter             | Type              | Description                                                                                                | Constraints | Required             |
| :-------------------- | :---------------- | :--------------------------------------------------------------------------------------------------------- | :---------- | :------------------- |
| refundedAmount        | Int(0...99999999) | Amount in the smallest currency subunit, as for example eurocents, that has already been refunded.         |             | :white\_check\_mark: |
| refundedPendingAmount | Int(1...99999999) | Amount in the smallest currency subunit, as for example eurocents, that has been requested to be refunded. |             | ✅                    |

## summaryItem

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Type",
    "h-2": "Description",
    "h-3": "Constraints",
    "h-4": "Required",
    "0-0": "status",
    "0-1": "String",
    "0-2": "`OPEN` - Payment has been created. This is the initial status.  \n`SUCCESS` - Payment successfully paid.  \n`CANCELLED` - Payment has been cancelled by your customers.  \n`EXPIRED` - Payment has not succeeded; expired.  \n`FAILURE` - Payment has not succeeded; unknown reason.",
    "0-3": "",
    "0-4": "",
    "1-0": "count",
    "1-1": "Int",
    "1-2": "The number of payments with the same status.",
    "1-3": "",
    "1-4": "",
    "2-0": "amount",
    "2-1": "Int(1...99999999)",
    "2-2": "Integer representing the amount of all the payments with the same status. Denomination in the smallest currency subunit (e.g. eurocents).",
    "2-3": "",
    "2-4": ""
  },
  "cols": 5,
  "rows": 3,
  "align": [
    "left",
    "left",
    "left",
    "left",
    "left"
  ]
}
[/block]

## requestedQRCodeInBulk

| Parameter        | Type                                                  | Description                                                                                                                                                                                                                                              | Constraints                                                         | Required                                 |
| :--------------- | :---------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------ | :--------------------------------------- |
| amountChangeable | [amountChangeable](schemas-2#amountchangeable) Object | Contains the minimum and maximum values for the amount of a QR code that your customers can set themselves after scanning the code.                                                                                                                      |                                                                     |                                          |
| reference        | String(1...255)                                       | An identifier specified by you. If webhooks were specified in the request this identifier is added to the webhook request payload.                                                                                                                       |                                                                     | **Only when not defined in `defaults`.** |
| amount           | Int(1...99999999)                                     | Integer representing the amount of the transaction. Denomination in the smallest currency subunit (e.g. eurocents).                                                                                                                                      |                                                                     | **Only when not defined in `defaults`.** |
| currency         | String (ISO 4217)                                     | ISO 4217 currency code.                                                                                                                                                                                                                                  |                                                                     |                                          |
| purchaseId       | String(1...35)                                        | Identification of the order within your system. Ultimately appears on the payment confirmation (statement and confirmation screen).                                                                                                                      |                                                                     |                                          |
| description      | String(1...255)                                       | Description of the transaction.                                                                                                                                                                                                                          |                                                                     | **Only when not defined in `defaults`.** |
| expiresAt        | String(RFC3339)                                       | Expiration time.                                                                                                                                                                                                                                         | ISO 8601 date and time.                                             | **Only when not defined in `defaults`.** |
| reusable         | Boolean                                               | Indicates the QR code's ability to accept multiple successful payments.                                                                                                                                                                                  |                                                                     |                                          |
| size             | Int(100...2000)                                       | Determines the size of the image in pixels. (e.g. A size of 200 will produce an image of \~200x200 pixels)                                                                                                                                               |                                                                     | **Only when not defined in `defaults`.** |
| language         | String(ISO 639-1)                                     | Preferred language of the user interface.                                                                                                                                                                                                                | ISO 639-1 language.                                                 | **Only when not defined in `defaults`.** |
| webhooks         | Array of objects                                      | Webhooks enable receiving a web request once a given event occurs.                                                                                                                                                                                       | Find more details [here](webhooks-1) .                              |                                          |
| returnUrl        | String(2000)                                          | Specifies the URL where your customers will be redirected to when the payment process is completed.                                                                                                                                                      | Either `returnUrl` or `returnUrls` must be specified, but not both. | **Only when not defined in `defaults`.** |
| returnUrls       | [returnUrls](schemas-2#returnurls)    Object          | Specifies a URL where your customers will be redirected to per transaction status when the payment process is completed. For example, your customers will be redirected to `returnUrls.success` when the status of the transaction changes to `SUCCESS`. | Either `returnUrl` or `returnUrls` must be specified, but not both. | **Only when not defined in `defaults`.** |

## defaultsForBulkRequest

| Parameter        | Type                                                   | Description                                                                                                                                                                                                        | Constraints                                                             | Required             |
| :--------------- | :----------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------- | :------------------- |
| amountChangeable | [amountChangeable](schemas-2#amountchangeable)  Object | Contains the minimum and maximum values for the amount of a QR code that your customers can set themselves after scanning the code.                                                                                |                                                                         |                      |
| reference        | String(1...255)                                        | An identifier specified by you. If webhooks were specified in the request this identifier is added to the webhook request payload.                                                                                 |                                                                         | :white\_check\_mark: |
| amount           | Int(1...99999999)                                      | Integer representing the amount of the transaction. Denomination in the smallest currency subunit (e.g. eurocents).                                                                                                |                                                                         | :white\_check\_mark: |
| currency         | String (ISO 4217)                                      | ISO 4217 currency code.                                                                                                                                                                                            |                                                                         |                      |
| purchaseId       | String(1...35)                                         | Identification of the order within your system. Ultimately appears on the payment confirmation (statement and confirmation screen).                                                                                |                                                                         |                      |
| description      | String(1...255)                                        | Description of the transaction.                                                                                                                                                                                    |                                                                         | :white\_check\_mark: |
| expiresAt        | String(RFC3339)                                        | Expiration time.                                                                                                                                                                                                   | ISO 8601 date and time.                                                 | :white\_check\_mark: |
| reusable         | Boolean                                                | Indicates the QR code's ability to accept multiple successful payments.                                                                                                                                            |                                                                         |                      |
| size             | Int(100...2000)                                        | Determines the size of the image in pixels. (e.g. A size of 200 will produce an image of \~200x200 pixels)                                                                                                         |                                                                         | :white\_check\_mark: |
| language         | String(ISO 639-1)                                      | Preferred language of the user interface.                                                                                                                                                                          | ISO 639-1 language.                                                     | :white\_check\_mark: |
| webhooks         | Array of objects                                       | Webhooks enable receiving a web request once a given event occurs.                                                                                                                                                 | Find more details [here](webhooks-1) .                                  |                      |
| returnUrl        | String(2000)                                           | Specifies the URL where your customers will be redirected to.                                                                                                                                                      | **Either `returnUrl` or `returnUrls` must be specified, but not both.** | ✅ See Constraints    |
| returnUrls       | [returnUrls](schemas-2#returnurls)     Object          | Specifies a URL where your customers will be redirected to per transaction status. For example, your customers will be redirected to `returnUrls.success` when the status of the transaction changes to `SUCCESS`. | **Either `returnUrl` or `returnUrls` must be specified, but not both.** | ✅ See Constraints    |

## error

| Parameter | Type       | Description                                | Constraints | Required             |
| :-------- | :--------- | :----------------------------------------- | :---------- | :------------------- |
| id        | String(36) | Unique identifier of the error.            |             | :white\_check\_mark: |
| message   | String     | A message indicating details of the error. |             | :white\_check\_mark: |

## QRCodesInBulk

| Parameter   | Type                                             | Description                                                 | Constraints                                                        | Required             |
| :---------- | :----------------------------------------------- | :---------------------------------------------------------- | :----------------------------------------------------------------- | :------------------- |
| created     | Boolean                                          | Indicates if a QR code transaction has been created or not. |                                                                    | :white\_check\_mark: |
| transaction | [QRTransaction](schemas-2#QRTransaction)  Object | QR transaction details.                                     | **Either `transaction` or `error` must be present, but not both.** | ✅ See Constraints    |
| error       | [error](schemas-2#error)  Object                 | Error details.                                              | **Either `transaction` or `error` must be present, but not both.** | ✅ See Constraints    |

## QRTransaction

| Parameter | Type                               | Description                                                                                                                                                           | Constraints | Required             |
| :-------- | :--------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------- | :------------------- |
| id        | String(36)                         | Transaction unique identifier. It can be used to retrieve the iDEAL QR code transaction details by using it in combination with other endpoints provided in this api. |             | :white\_check\_mark: |
| action    | [action](schemas-2#action)  Object | The next action to be performed by you for this transaction. This includes the URL of the iDEAL QR code image to be shown to your customer.                           |             | :white\_check\_mark: |