> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flinks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# /Upload (Base Example)

> Use the standard /Upload endpoint to upload transaction data and receive calculated attributes.

Please select your required endpoint based on information you read in the previous section. All endpoints follow the same format, and all demand a POST call to their respective URLs with a JSON body request.

For this documentation, we will use the standard `/Upload` endpoint to run through some examples. If you are using any of the other endpoints listed above, the only difference is that you do not need to include an `Attributes` or `AttributesDetail` list.

<Warning>
  <p class="h4">A note on Authorization</p>

  In order to access and use any of the `/Upload` endpoints, you will need a secret authorization token from Flinks. If you do not already have one, please reach out to your Flinks Representative.
</Warning>

<Note>
  <p class="h4">A note on Use Case and All Attributes endpoints</p>

  The `Card` and `AttributesDetails` objects within these requests are not required and, if provided, will be overwritten with the expected Attributes contained within the requested endpoint.
</Note>

## Request Fields

| **NAME**          | **DESCRIPTION**                                                                                                                                                                                                                                                                                                                                                                                                                  | Required?                                                         |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| Card              | Contains the list of Attributes that will be returned for the given set of transactions.                                                                                                                                                                                                                                                                                                                                         | Yes                                                               |
| Origin Country    | Tells the API to use a specific country model. The only accepted values are 'ca' or 'us'.                                                                                                                                                                                                                                                                                                                                        | Yes                                                               |
| MostRecentBalance | Tells the API what the MostRecentBalance was for these transactions. This is an alternative to attaching a balance to every transaction. If provided, Flinks will calculate the running balance per transaction using the provided figure. Please provide us the balance as of the most recent transaction here. If using this option, do not include the balance field in your transaction set or use `OldestBalance`.          | Yes (if not using balance per transaction or `OldestBalance`)     |
| OldestBalance     | Tells the API what the Oldest Balance was for those transactions. This is an alternative to attaching a balance to every transaction. If provided, Flinks will calculate the running balance per transaction using the provided figure. Please provide us the balance as of the oldest (historic) transaction here. If using this option, do not include the balance field in your transaction field or use `MostRecentBalance`. | Yes (If not using balance per transaction or `MostRecentBalance`) |
| AttributesDetail  | This will return an object in the response that contains the relevant transactions for all Attributes that are contained here. Please refer to our Attributes documentation for more information.                                                                                                                                                                                                                                | No                                                                |
| Transactions      | Contains the previously formatted transactions (defined earlier in this documentation) that you are uploading to Flinks.                                                                                                                                                                                                                                                                                                         | Yes                                                               |


## OpenAPI

````yaml POST /v3/{customerId}/attributes/upload
openapi: 3.0.3
info:
  title: Flinks API
  description: >
    Flinks API provides financial data connectivity, enrichment, and payment
    solutions.


    ## Authentication

    Endpoints require authentication using `flinks-auth-key` header (Bearer
    token).


    For more information, visit: https://docs.flinks.com
  version: 3.0.0
  contact:
    name: Flinks Support
    url: https://www.flinks.com/contact/sales
  termsOfService: https://www.flinks.com
servers:
  - url: https://{instance}-api.private.fin.ag
    description: Flinks Upload API
    variables:
      instance:
        default: toolbox
        description: The environment instance (e.g., toolbox, sandbox)
security: []
tags:
  - name: Authorization
    description: Endpoints for generating authorization tokens and authenticating requests
  - name: Enrich - Consumer Attributes
    description: Consumer financial attribute analysis and credit risk assessment
paths:
  /v3/{customerId}/attributes/upload:
    post:
      tags:
        - Upload
      summary: Upload (Base Example)
      description: >-
        Use the standard /Upload endpoint to upload transaction data and receive
        calculated attributes.
      operationId: uploadBase
      parameters:
        - name: customerId
          in: path
          required: true
          schema:
            type: string
          description: >-
            Unique GUID provided by Flinks that grants you access to the
            environment.
        - name: Authorization
          in: header
          description: Bearer Token (API secret key).
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - Origin Country
              properties:
                Card:
                  type: string
                  description: >-
                    Contains the list of Attributes that will be returned for
                    the given set of transactions. (JSON object)
                Origin Country:
                  type: string
                  enum:
                    - ca
                    - us
                  description: >-
                    Tells the API to use a specific country model. Possible
                    values include: - `ca` = Canada - `us` = United States
                MostRecentBalance:
                  type: string
                  description: >
                    The most recent balance for all transactions. Flinks uses
                    this parameter to calculate the running balance if you are
                    not passing the `balance` field in your transaction set or
                    using `OldestBalance`.


                    If you are not using `balance` in the transaction set or
                    `OldestBalance`, this parameter is required.
                OldestBalance:
                  type: string
                  description: >
                    The oldest balance of all transactions. Flinks uses this
                    parameter to calculate the running balance if you are
                    **not** passing the `balance` field in your transaction set
                    or using `MostRecentBalance`.


                    If you are not using `balance` in the transaction set or
                    `MostRecentBalance`, this parameter is required.
                AttributesDetail:
                  type: array
                  items:
                    type: string
                  description: >-
                    List of Attributes that you require the underlying
                    transactions to be returned from. Attribute names included
                    here must also be included in the Attributes list.
                Transactions:
                  type: string
                  description: >-
                    Contains the previously formatted transactions (defined
                    earlier in this documentation) that you are uploading to
                    Flinks. (JSON array of objects)
                Options:
                  type: array
                  items:
                    type: string
                  description: Additional parameters that you want to include.
              example:
                Origin Country: us
      responses:
        '200':
          description: Result
          content:
            application/json:
              schema:
                type: object
                properties:
                  HttpStatusCode:
                    type: integer
                    default: 0
                  Card:
                    type: object
                    properties:
                      sum_debits_30_days:
                        type: integer
                        default: 0
                      AttributesDetail:
                        type: array
                        items:
                          type: object
                          properties:
                            Attribute:
                              type: string
                            Transactions:
                              type: array
                              items:
                                type: object
                                properties:
                                  TransactionId:
                                    type: string
                                  AccountId:
                                    type: string
                                  Date:
                                    type: string
                                  Description:
                                    type: string
                                  Debit:
                                    type: number
                                    default: 0
                                  Credit:
                                    type: number
                                  Balance:
                                    type: number
                                    default: 0
                  requestId:
                    type: string
        '400':
          description: Result
          content:
            application/json:
              schema:
                type: object

````