# Models

## Wallet

|    Field   |    Type   | Description                                                         |
| :--------: | :-------: | ------------------------------------------------------------------- |
|  createdAt |  `string` | Date of creation. Format: `Timestamp`.                              |
| customData |  `object` | May contain some additional information about the wallet.           |
|     id     |  `string` | Wallet identifier. Format: `uuid`.                                  |
|   locked   | `boolean` | The wallet cannot be used if locked.                                |
|  metadata  |  `object` | May contain some additional information about the application core. |
|    name    |  `string` | Wallet name. Max length: 255.                                       |
|   ownerId  |  `string` | User ID the wallet belongs to. Format: `uuid`.                      |
|  reference |  `string` | User ID the wallet belongs to. Max length: 10.                      |
|  updatedAt |  `string` | Date of last update. Format: `Timestamp`.                           |

### Address

| Field     |   Type   | Description                                                      |
| --------- | :------: | ---------------------------------------------------------------- |
| address   | `string` | Address identifier.                                              |
| assetCode | `string` | Asset code related to the address.                               |
| createdAt | `string` | Date of creation. Format: `Timestamp`.                           |
| metadada  | `object` | May contain additional information.                              |
| updatedAt | `string` | Date of last update. Format: `Timestamp`.                        |
| walletId  | `string` | Identifier of the wallet the address belongs to. Format: `uuid`. |

### Asset

| Field         |    Type   | Description                                                             |
| ------------- | :-------: | ----------------------------------------------------------------------- |
| code          |  `string` | Asset identifier code. Pattern: `^[a-zA-Z0-9]*$`.                       |
| configuration |  `object` | Additional asset configuration.                                         |
| contract      |  `object` | Asset contract configuration. Only applicable to crypto assets.         |
| createdAt     |  `string` | Date of creation. Format: `Timestamp`.                                  |
| customData    |  `object` | Stores any additional information about the asset.                      |
| decimalPlaces | `integer` | Number of decimal places.                                               |
| enabled       | `boolean` | Asset availability.                                                     |
| metadata      |  `object` | May contain some additional information about the application core.     |
| name          |  `string` | Asset name.                                                             |
| symbol        |  `string` | Asset symbol. Max length: 16.                                           |
| system        | `boolean` | Defines if the it's a system asset, i.e., intrinsic to the application. |
| updatedAt     |  `string` | Date of last update. Format: `Timestamp`.                               |

### Payment Method

| Field    |    Type   | Description                                                                                               |
| -------- | :-------: | --------------------------------------------------------------------------------------------------------- |
| enabled  | `boolean` | Defines if the payment method is available to use.                                                        |
| metadata |  `object` | Store some additional information about the payment method, usually public and (obfuscated) private keys. |
| name     |  `string` | Payment method name.                                                                                      |
| slug     |  `string` | Payment method identifier.                                                                                |

### Movement

|     Field     |      Type      | Description                                                                                                                                         |
| :-----------: | :------------: | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|     amount    |    `string`    | Transacted amount. The amount is negative if the movement corresponds to an extraction of assets.                                                   |
|   assetCode   |    `string`    | Code of the asset being transacted.                                                                                                                 |
|      code     | `enum<string>` | Movement code.                                                                                                                                      |
|   createdAt   |    `string`    | Date of creation. Format: `Timestamp`.                                                                                                              |
|       id      |    `string`    | Movement identifier. Format: `uuid`.                                                                                                                |
|    metadata   |    `object`    | May contain some additional information about the application core.                                                                                 |
|  transaction  |    `object`    | Contains the related transaction details. This object only returns if the query string `include=transaction` is set when requesting movements data. |
| transactionId |    `string`    | ID of the related transaction. Format: `uuid`.                                                                                                      |
|   updatedAt   |    `string`    | Date of last update. Format: `Timestamp`.                                                                                                           |
|    walletId   |    `string`    | ID of the wallet where the assets were withdrawn or deposited. Format: `uuid`.                                                                      |

#### Code Options

The movement code may be one of the following:

|    Field   |   Type   | Description                                         |
| :--------: | :------: | --------------------------------------------------- |
|   deposit  | `string` | The movement corresponds to a deposit operation.    |
| withdrawal | `string` | The movement corresponds to a withdrawal operation. |

### Transaction

|        Field        |      Type      | Description                                                                                                                                                                                   |
| :-----------------: | :------------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|        amount       |    `string`    | Transacted amount.                                                                                                                                                                            |
|      assetCode      |    `string`    | Code of the asset being transacted.                                                                                                                                                           |
|         code        |    `string`    | Defines through which `feature` and `method` the assets will be transacted (there are more informations about this on each `type` of transaction create endpoint).                            |
|      createdAt      |    `string`    | Date of creation. Format: `Timestamp`.                                                                                                                                                        |
|      customData     |    `object`    | Stores any additional information the users may provide.                                                                                                                                      |
|     description     |    `string`    | A free text field.                                                                                                                                                                            |
|  destinationAddress |    `string`    | Destination address.                                                                                                                                                                          |
| destinationWalletId |    `string`    | ID of the wallet where the assets are being deposited. This field is not applicable to withdrawal transactions type so it returns with `null` value under that circumstances. Format: `uuid`. |
|      externalId     |    `string`    | External identifier. An example of it is a bitcoin `hash`.                                                                                                                                    |
|  externalReference  |    `string`    | External reference.                                                                                                                                                                           |
|          id         |    `string`    | Transaction identifier. Format: `uuid`.                                                                                                                                                       |
|       metadata      |    `object`    | May contain some additional information about the application core.                                                                                                                           |
|    originAddress    |    `string`    | Origin address.                                                                                                                                                                               |
|    originWalletId   |    `string`    | ID of the wallet from where the assets are coming. This field is not applicable to deposit transactions type so it returns with `null` value under that circumstances. Format: `uuid`.        |
|        status       | `enum<string>` | Current transaction status.                                                                                                                                                                   |
|         type        | `enum<string>` | Transaction type.                                                                                                                                                                             |
|      updatedAt      |    `string`    | Date of last update. Format: `Timestamp`.                                                                                                                                                     |

#### Type Options

The transaction type may be one of the following:

|    Field   | Type     |
| :--------: | -------- |
|   deposit  | `string` |
|  transfer  | `string` |
| withdrawal | `string` |

#### Status Options

The transaction `status` may be one of the following:

|    Field   |   Type   | Description                                             |
| :--------: | :------: | ------------------------------------------------------- |
|  completed | `string` | The transaction is already completed. Final status.     |
|   failed   | `string` | An error occurred during the transaction. Final status. |
|   pending  | `string` | Initial transaction status.                             |
| processing | `string` | Transaction is waiting to be confirmed.                 |
|  rejected  | `string` | The transaction was rejected. Final status.             |

## User

|      Field      |       Type      | Description                                                       |
| :-------------: | :-------------: | ----------------------------------------------------------------- |
|     approved    |    `boolean`    | Defines if the user is approved. If false, the user cannot login. |
|     blocked     |    `boolean`    | Defines if the user is blocked. If true, the user cannot login.   |
|    createdAt    |     `string`    | Date of creation. Format: `Timestamp`.                            |
|    customData   |     `object`    | Stores any additional information about the user.                 |
|      email      |     `string`    | User email. Format: `email`.                                      |
|        id       |     `string`    | User identifier. Format: `uuid`.                                  |
|       name      |     `string`    | User name.                                                        |
|      phone      |     `string`    | User phone number. `E.164` standard.                              |
| primaryWalletId |     `string`    | User main wallet. Format: `uuid`.                                 |
|      roles      | `Array<string>` | List of user's access roles.                                      |
|    updatedAt    |     `string`    | Date of last update. Format: `Timestamp`.                         |
|     verified    |    `boolean`    | Whether or not the User’s email has been verified.                |

## Store

### Category

|    Field    |       Type       | Description                                                   |
| :---------: | :--------------: | ------------------------------------------------------------- |
|  createdAt  |     `string`     | Date of creation. Format: `Timestamp`.                        |
|  customData |     `object`     | Stores any additional information about the category.         |
| description |     `string`     | Category description.                                         |
|      id     |     `string`     | Category identifier. Format: `uuid`.                          |
|   imageUrl  |     `string`     | Category image URL.                                           |
|   products  | `array<Product>` | List of associated products. Needs to be explicitly required. |
|    title    |     `string`     | Category title.                                               |
|  updatedAt  |     `string`     | Date of last update. Format: `Timestamp`.                     |

### Order

|         Field         |        Type        | Description                                                      |
| :-------------------: | :----------------: | ---------------------------------------------------------------- |
|         amount        |      `string`      | Order amount value.                                              |
| amountWithoutShipment |      `string`      | Order amount value without shipment.                             |
|   amountWithoutTaxes  |      `string`      | Order amount value without taxes.                                |
|       assetCode       |      `string`      | Asset code related to the order.                                 |
|         bonus         |      `string`      | Order bonus value.                                               |
|     bonusAssetCode    |      `string`      | Asset code related to the order bonus.                           |
|       canceledAt      |      `string`      | Cancel date. Format: `Timestamp`.                                |
|      cancelReason     |      `string`      | Reason for the cancelation.                                      |
|  chosenPaymentMethod  |      `string`      | Order chosen payment method. This value is merely indicative.    |
|       createdAt       |      `string`      | Date of creation. Format: `Timestamp`.                           |
|       customData      |      `object`      | Stores any additional information about the order.               |
|     deliveryMethod    |      `string`      | Delivery method for the order.                                   |
|      fulfilledAt      |      `string`      | Date of fulfilment. Format: `Timestamp`.                         |
|           id          |      `string`      | Order identifier. Format: `uuid`.                                |
|         lines         | `array<OrderLine>` | List of associated order lines. Needs to be explicitly required. |
|        metadata       |      `object`      | Order metadata.                                                  |
|       netAmount       |      `string`      | Order net amount value.                                          |
|      orderStatus      |      `string`      | Order status.                                                    |
|       paidAmount      |      `string`      | Order paid amount value.                                         |
|         paidAt        |      `string`      | Date of payment. Format: `Timestamp`.                            |
|     paymentDetails    |      `object`      | Stores details about the payment.                                |
|     paymentStatus     |      `string`      | Order payment status.                                            |
|       reference       |      `string`      | Order reference.                                                 |
|      refundAmount     |      `string`      | Order refund amount value.                                       |
|      refundReason     |      `string`      | Reason for the refund.                                           |
|    shippingAddress    |  `ShippingAddress` | Associated shipping address.                                     |
|     shippingAmount    |      `string`      | Order shipping amount value.                                     |
|      taxesAmount      |      `string`      | Order taxes amount value.                                        |
|      taxesDetails     |      `object`      | Stores details about the taxes.                                  |
|       trackingId      |      `string`      | Order tracking identifier. Format: `uuid`.                       |
|      unpaidAmount     |      `string`      | Order unpaid amount value.                                       |
|       updatedAt       |      `string`      | Date of last update. Format: `Timestamp`.                        |
|          user         |       `User`       | Associated user. Needs to be explicitly required.                |
|         userId        |      `string`      | Associated user identifier. Format: `uuid`.                      |
|       userNotes       |      `string`      | Order user notes.                                                |

#### Order status

The order status may be one of the following:

|    Field    | Type     |
| :---------: | -------- |
|   canceled  | `string` |
|    draft    | `string` |
|  fulfilled  | `string` |
| unfulfilled | `string` |

#### Payment status

The payment status may be one of the following:

|        Field        | Type     |
| :-----------------: | -------- |
|     fully\_paid     | `string` |
|   fully\_refunded   | `string` |
|   partially\_paid   | `string` |
| partially\_refunded | `string` |
|        unpaid       | `string` |

### Order line

|          Field         |    Type   | Description                                          |
| :--------------------: | :-------: | ---------------------------------------------------- |
|        assetCode       |  `string` | Asset code related to the order line.                |
|     bonusAssetCode     |  `string` | Asset code related to the order line bonus.          |
|        createdAt       |  `string` | Date of creation. Format: `Timestamp`.               |
|       fulfilledAt      |  `string` | Date of fulfilment. Format: `Timestamp`.             |
|    fulfilledQuantity   |  `string` | Fulfilled quantity of the order line.                |
|           id           |  `string` | Order line identifier. Format: `uuid`.               |
|        metadata        |  `object` | Order line metadata.                                 |
|          order         |  `Order`  | Associated order. Needs to be explicitly required.   |
|         orderId        |  `string` | Associated order identifier. Format: `uuid`.         |
|         product        | `Product` | Associated product. Needs to be explicitly required. |
|        productId       |  `string` | Associated product identifier. Format: `uuid`.       |
| productQuestionsResult |  `object` | Order line product questions result.                 |
|        quantity        |  `string` | Order line total quantity.                           |
|         status         |  `string` | Order line status.                                   |
|        unitBonus       |  `string` | Order line unit bonus value.                         |
|      unitNetPrice      |  `string` | Order line unit net price value.                     |
|        unitPrice       |  `object` | Order line unit price value.                         |
|         unitTax        |  `string` | Order line unit tax value.                           |
|        updatedAt       |  `string` | Date of last update. Format: `Timestamp`.            |

#### Order line status

The payment status may be one of the following:

|         Field        | Type     |
| :------------------: | -------- |
|       fulfilled      | `string` |
| partially\_fulfilled | `string` |
|      unfulfilled     | `string` |

### Product

|         Field         |        Type       | Description                                                                        |
| :-------------------: | :---------------: | ---------------------------------------------------------------------------------- |
| allowChoosingQuantity |     `boolean`     | Product choosing quantity allow indicator.                                         |
|       assetCode       |      `string`     | Asset code related to the product.                                                 |
|       available       |     `boolean`     | Product availability indicator.                                                    |
|         bonus         |      `string`     | Product bonus value.                                                               |
|      buttonLabel      |      `string`     | Product button label.                                                              |
|        category       |     `Category`    | Associated category. Needs to be explicitly required.                              |
|       categoryId      |      `string`     | Associated category identifier. Format: `uuid`.                                    |
|       createdAt       |      `string`     | Date of creation. Format: `Timestamp`.                                             |
|       customData      |      `string`     | Stores any additional information about the product.                               |
|      description      |      `string`     | Product description.                                                               |
|        featured       |     `boolean`     | Product featuring indicator.                                                       |
|           id          |      `string`     | Product identifier. Format: `uuid`.                                                |
|        imageUrl       |      `string`     | Product image URL.                                                                 |
|       listLabel       |      `string`     | Product list label.                                                                |
|        metadata       |      `object`     | Product metadata.                                                                  |
|          name         |      `string`     | Product name.                                                                      |
|         price         |      `string`     | Product price value.                                                               |
|      priceWithTax     |      `string`     | Product price value with tax.                                                      |
|       questions       | `array<Question>` | List of associated questions. Needs to be explicitly required.                     |
|    requiresIdentity   |     `boolean`     | Identity required indicator.                                                       |
|       taxAmount       |      `string`     | Product tax amount value.                                                          |
|        taxRate        |     `TaxRate`     | Associated tax rate. Needs to be explicitly required.                              |
|       taxRateId       |      `string`     | Associated tax rate identifier. Format: `uuid`.                                    |
|      thumbnailUrl     |      `string`     | Product thumbnail URL.                                                             |
|          type         |   `ProductType`   | Associated product type. Needs to be explicitly required.                          |
|        typeCode       |      `string`     | Associated question type code. One of `date`, `multiple`, `single`, `text`, `time` |
|       updatedAt       |      `string`     | Date of last update. Format: `Timestamp`.                                          |
|          url          |      `string`     | Product URL.                                                                       |
|        visible        |     `boolean`     | Product visibility indicator.                                                      |

### Product Type

|   Field   |   Type   | Description                               |
| :-------: | :------: | ----------------------------------------- |
|    code   | `string` | Product type code.                        |
| createdAt | `string` | Date of creation. Format: `Timestamp`.    |
| updatedAt | `string` | Date of last update. Format: `Timestamp`. |

### Question

|      Field      |      Type      | Description                                                |
| :-------------: | :------------: | ---------------------------------------------------------- |
|  configurations |    `object`    | Contains all question configurations.                      |
|    createdAt    |    `string`    | Date of creation. Format: `Timestamp`.                     |
|    customData   |    `object`    | Stores any additional information about the question.      |
|   description   |    `string`    | Question description.                                      |
|        id       |    `string`    | Question identifier. Format: `uuid`.                       |
|     metadata    |    `object`    | Question metadata.                                         |
| productTypeCode |    `string`    | Associated product type code.                              |
|   questionType  | `QuestionType` | Associated question type. Needs to be explicitly required. |
|     required    |    `boolean`   | Required indicator.                                        |
|      title      |    `string`    | Question title.                                            |
|     typeCode    |    `string`    | Question type code.                                        |
|    updatedAt    |    `string`    | Date of last update. Format: `Timestamp`.                  |

### Task

|     Field    |    Type   | Description                                       |
| :----------: | :-------: | ------------------------------------------------- |
|    amount    |  `string` | Task amount value.                                |
|   available  | `boolean` | Task availability indicator.                      |
|  buttonLabel |  `string` | Task button label.                                |
|   createdAt  |  `string` | Date of creation. Format: `Timestamp`.            |
|  customData  |  `object` | Stores any additional information about the task. |
|  description |  `string` | Task description.                                 |
|    enabled   | `boolean` | Task enable indicator.                            |
|   featured   | `boolean` | Task featuring indicator.                         |
|      id      |  `string` | Task identifier. Format: `uuid`.                  |
|   imageUrl   |  `string` | Task image URL.                                   |
|   metadata   |  `object` | Task metadata.                                    |
|     name     |  `string` | Task name.                                        |
|   surveyUrl  |  `string` | Task survey URL.                                  |
| thumbnailUrl |  `string` | Task thumbnail URL.                               |
|     type     |  `string` | Task type.                                        |
|   updatedAt  |  `string` | Date of last update. Format: `Timestamp`.         |

### Tax rate

|   Field   |   Type   | Description                               |
| :-------: | :------: | ----------------------------------------- |
| createdAt | `string` | Date of creation. Format: `Timestamp`.    |
|     id    | `string` | Tax rate identifier. Format: `uuid`.      |
|    name   | `string` | Tax rate name.                            |
|    rate   | `string` | Tax rate value.                           |
| updatedAt | `string` | Date of last update. Format: `Timestamp`. |
