# Schemas

Schemas used in requests/responses of our API:

## invoice

| Parameter   | Type              | Description                                                                                                                        | Constraints     | Required             |
| :---------- | :---------------- | :--------------------------------------------------------------------------------------------------------------------------------- | :-------------- | :------------------- |
| 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 total amount of the transaction. Denomination in the smallest currency subunit (e.g. eurocents).          | `>= 5000 cents` | :white\_check\_mark: |
| description | String(1...255)   | Description of the transaction. Ultimately appears on the payment confirmation (statement and confirmation screen).                |                 | :white\_check\_mark: |

## consumer

| Parameter       | Type                                    | Description                                                                                                                                                                                         | Constraints | Required             |
| :-------------- | :-------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------- | :------------------- |
| name            | [name](schemas-7#name) Object           | Customer name.                                                                                                                                                                                      |             | ✅                    |
| phone           | String                                  | Customer phone number.                                                                                                                                                                              |             | ✅                    |
| email           | String                                  | Email provided by customer.                                                                                                                                                                         |             | :white\_check\_mark: |
| dateOfBirth     | String                                  | Date of birth of the customer.                                                                                                                                                                      |             | ✅                    |
| shippingAddress | [address](schemas-7#address) Object     | Shipping address.                                                                                                                                                                                   |             | ✅                    |
| invoiceAddress  | [address](schemas-7#address)  Object    | Invoice address.                                                                                                                                                                                    |             |                      |
| business        | [business](schemas-7#business)   Object | This feature is used when the one making the purchase is a business. **If you decide to use this feature please inform us so that we can ask IN3 activate B2B functionality for your IN3 account**. | nullable    |                      |

## name

| Parameter | Type            | Description             | Constraints | Required             |
| :-------- | :-------------- | :---------------------- | :---------- | :------------------- |
| initials  | String(1...20)  | Customer name initials. |             |                      |
| lastName  | String(1...250) | Customer last name.     |             | :white\_check\_mark: |

## address

| Parameter         | Type            | Description                                                | Constraints              | Required |
| :---------------- | :-------------- | :--------------------------------------------------------- | :----------------------- | :------- |
| addressedTo       | String(1...250) | The name or entity which shall accept the package/invoice. |                          |          |
| street            | String(1...128) | Street.                                                    |                          | ✅        |
| houseNumber       | String(1...25)  | House number.                                              |                          | ✅        |
| houseNumberSuffix | String(1...25)  | House number suffix.                                       |                          |          |
| postalCode        | String(1...25)  | Postal code.                                               |                          | ✅        |
| city              | String(1...128) | City.                                                      |                          | ✅        |
| countryCode       | String          | Country code.                                              | ISO 3166-1 country code. | ✅        |
| state             | String(1...40)  | State.                                                     |                          |          |

## business

| Parameter | Type            | Description                                     | Constraints | Required |
| :-------- | :-------------- | :---------------------------------------------- | :---------- | :------- |
| name      | String(1...35)  | The name of the purchasing business.            |             | ✅        |
| lastName  | String(1...250) | The Chamber of Commerce number of the business. |             | ✅        |

## item

| Parameter   | Type                | Description                                                                                                   | Constraints | Required             |
| :---------- | :------------------ | :------------------------------------------------------------------------------------------------------------ | :---------- | :------------------- |
| code        | String(1...50)      | A code that identifies the item.                                                                              |             | :white\_check\_mark: |
| name        | String(1...50)      | A human readable name for the item.                                                                           |             |                      |
| description | String(1...100)     | Item description.                                                                                             |             | ✅                    |
| unitPrice   | Int(1...99999999)   | Unit price (including VAT) of the item, specified in the smallest currency subunit, as for example eurocents. |             | ✅                    |
| quantity    | Int(1...1000000000) | The number of items.                                                                                          |             | ✅                    |
| vatAmount   | Int(1...99999999)   | VAT amount of one unit, specified in the smallest currency subunit, as for example eurocents.                 |             | ✅                    |
| vatRate     | Number(0...99.9)    | Percentage of VAT applied. Only the first decimal value will be taken into account, the rest will be ignored. |             | ✅                    |

## action

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

## redirect

| Parameter | Type   | Description                                                                        | Constraints | Required |
| :-------- | :----- | :--------------------------------------------------------------------------------- | :---------- | :------- |
| url       | String | URL where consumer should be redirected to by the merchant to perform the payment. |             |          |

## 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: |

## refund

| Parameter     | Type              | Description                                                                    | Constraints             | Required |
| :------------ | :---------------- | :----------------------------------------------------------------------------- | :---------------------- | :------- |
| id            | String(36)        | Refund unique identifier.                                                      |                         | ✅        |
| transactionId | String(36)        | Unique identifier of the transaction related to this refund.                   |                         | ✅        |
| amount        | Int(1...99999999) | Refund amount. Denomination in the smallest currency subunit (e.g. eurocents). |                         | ✅        |
| reason        | String(255)       | The description for the refund.                                                |                         | ✅        |
| created       | String(RFC3339)   | Creation time.                                                                 | ISO 8601 date and time. | ✅        |
| updated       | String(RFC3339)   | Updated time.                                                                  | ISO 8601 date and time. | ✅        |