Class NewTransaction

java.lang.Object
cm.xd.genapi.ynab.model.NewTransaction

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2026-04-26T18:05:30.720340+02:00[Europe/Stockholm]", comments="Generator version: 7.21.0") public class NewTransaction extends Object
NewTransaction
  • Field Details

  • Constructor Details

    • NewTransaction

      public NewTransaction()
  • Method Details

    • accountId

      public NewTransaction accountId(@Nullable UUID accountId)
    • getAccountId

      @Nullable public UUID getAccountId()
      Get accountId
      Returns:
      accountId
    • setAccountId

      public void setAccountId(@Nullable UUID accountId)
    • date

      public NewTransaction date(@Nullable LocalDate date)
    • getDate

      @Nullable public LocalDate getDate()
      The transaction date in ISO format (e.g. 2016-12-01). Future dates (scheduled transactions) are not permitted. Split transaction dates cannot be changed and if a different date is supplied it will be ignored.
      Returns:
      date
    • setDate

      public void setDate(@Nullable LocalDate date)
    • amount

      public NewTransaction amount(@Nullable Long amount)
    • getAmount

      @Nullable public Long getAmount()
      The transaction amount in milliunits format. Split transaction amounts cannot be changed and if a different amount is supplied it will be ignored.
      Returns:
      amount
    • setAmount

      public void setAmount(@Nullable Long amount)
    • payeeId

      public NewTransaction payeeId(@Nullable UUID payeeId)
    • getPayeeId

      @Nullable public UUID getPayeeId()
      The payee for the transaction. To create a transfer between two accounts, use the account transfer payee pointing to the target account. Account transfer payees are specified as `transfer_payee_id` on the account resource.
      Returns:
      payeeId
    • setPayeeId

      public void setPayeeId(@Nullable UUID payeeId)
    • payeeName

      public NewTransaction payeeName(@Nullable String payeeName)
    • getPayeeName

      @Nullable public String getPayeeName()
      The payee name. If a `payee_name` value is provided and `payee_id` has a null value, the `payee_name` value will be used to resolve the payee by either (1) a matching payee rename rule (only if `import_id` is also specified) or (2) a payee with the same name or (3) creation of a new payee.
      Returns:
      payeeName
    • setPayeeName

      public void setPayeeName(@Nullable String payeeName)
    • categoryId

      public NewTransaction categoryId(@Nullable UUID categoryId)
    • getCategoryId

      @Nullable public UUID getCategoryId()
      The category for the transaction. To configure a split transaction, you can specify null for `category_id` and provide a `subtransactions` array as part of the transaction object. If an existing transaction is a split, the `category_id` cannot be changed. Credit Card Payment categories are not permitted and will be ignored if supplied.
      Returns:
      categoryId
    • setCategoryId

      public void setCategoryId(@Nullable UUID categoryId)
    • memo

      public NewTransaction memo(@Nullable String memo)
    • getMemo

      @Nullable public String getMemo()
      Get memo
      Returns:
      memo
    • setMemo

      public void setMemo(@Nullable String memo)
    • cleared

      public NewTransaction cleared(@Nullable TransactionClearedStatus cleared)
    • getCleared

      @Nullable public TransactionClearedStatus getCleared()
      Get cleared
      Returns:
      cleared
    • setCleared

      public void setCleared(@Nullable TransactionClearedStatus cleared)
    • approved

      public NewTransaction approved(@Nullable Boolean approved)
    • getApproved

      @Nullable public Boolean getApproved()
      Whether or not the transaction is approved. If not supplied, transaction will be unapproved by default.
      Returns:
      approved
    • setApproved

      public void setApproved(@Nullable Boolean approved)
    • flagColor

      public NewTransaction flagColor(@Nullable TransactionFlagColor flagColor)
    • getFlagColor

      @Nullable public TransactionFlagColor getFlagColor()
      Get flagColor
      Returns:
      flagColor
    • setFlagColor

      public void setFlagColor(@Nullable TransactionFlagColor flagColor)
    • subtransactions

      public NewTransaction subtransactions(@Nullable List<SaveSubTransaction> subtransactions)
    • addSubtransactionsItem

      public NewTransaction addSubtransactionsItem(SaveSubTransaction subtransactionsItem)
    • getSubtransactions

      @Nullable public List<SaveSubTransaction> getSubtransactions()
      An array of subtransactions to configure a transaction as a split. Updating `subtransactions` on an existing split transaction is not supported.
      Returns:
      subtransactions
    • setSubtransactions

      public void setSubtransactions(@Nullable List<SaveSubTransaction> subtransactions)
    • importId

      public NewTransaction importId(@Nullable String importId)
    • getImportId

      @Nullable public String getImportId()
      If specified, a new transaction will be assigned this `import_id` and considered \"imported\". We will also attempt to match this imported transaction to an existing \"user-entered\" transaction on the same account, with the same amount, and with a date +/-10 days from the imported transaction date.<br><br>Transactions imported through File Based Import or Direct Import (not through the API) are assigned an import_id in the format: 'YNAB:[milliunit_amount]:[iso_date]:[occurrence]'. For example, a transaction dated 2015-12-30 in the amount of -$294.23 USD would have an import_id of 'YNAB:-294230:2015-12-30:1'. If a second transaction on the same account was imported and had the same date and same amount, its import_id would be 'YNAB:-294230:2015-12-30:2'. Using a consistent format will prevent duplicates through Direct Import and File Based Import.<br><br>If import_id is omitted or specified as null, the transaction will be treated as a \"user-entered\" transaction. As such, it will be eligible to be matched against transactions later being imported (via DI, FBI, or API).
      Returns:
      importId
    • setImportId

      public void setImportId(@Nullable String importId)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • validateJsonElement

      public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOException
      Validates the JSON Element and throws an exception if issues found
      Parameters:
      jsonElement - JSON Element
      Throws:
      IOException - if the JSON Element is invalid with respect to NewTransaction
    • fromJson

      public static NewTransaction fromJson(String jsonString) throws IOException
      Create an instance of NewTransaction given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of NewTransaction
      Throws:
      IOException - if the JSON string is invalid with respect to NewTransaction
    • toJson

      public String toJson()
      Convert an instance of NewTransaction to an JSON string
      Returns:
      JSON string