Answers.Body: <p>The error message says TransactionID or InvoiceID not AND as you say in your question.</p>
  <p>To get round this I would just edit your CSV so that you add a suffix &quot;-1&quot; &quot;-2&quot; etc to one of these fields where they would otherwise be the same. That way you can still see they are related when you look at them later.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-23T02:23:16.233Z
Answers.Text: I was suggesting that the OR meant that it requires both the Transaction ID AND the Invoice ID to be unique, not from each other, but within their own fields.
Answers.UserDisplayName: jsherk
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-23T08:43:04.770Z
Answers.Text: Reading the error message again I see that your interpretation is correct!
Answers.UserDisplayName: Mick Kahn
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-22T21:09:27.700Z
Answers.LastActivityDate: 2022-01-22T21:09:27.700Z
Answers.UserDisplayName: Mick Kahn
Answers.Body: <p>This is what line items are designed for. The contribution table will have $100 with the transaction id, invoice id etc with a financial type of X (we use Donation). Then the line item table has two entries. One for $75 for Building Fund and another entry of $25 for General Fund.
  In the import process this requires multiple imports. Once for the contribution table and once for the line item table.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-24T22:16:32.470Z
Answers.Text: I do not see anything related to Import Contributions that allows me to add a line item or to import them as line items instead of just a single contribution. I do not even see any way to add a line item when manually using New Contribution or editing an exising contribution.
Answers.UserDisplayName: jsherk
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-25T16:44:42.443Z
Answers.Text: I used https://civicrm.org/extensions/api-csv-import-gui  But you have to do it in two steps. Do the contribution import first. Then do the line item table and be sure that the contribution id is included.
Answers.UserDisplayName: Iowa Boy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-23T04:52:05.450Z
Answers.LastActivityDate: 2022-01-23T04:52:05.450Z
Answers.UserDisplayName: Iowa Boy
Answers.Body: <p>As mentioned in my comment, this scenario would involve firstly importing the Contribution, then importing the Line Items.</p>
  <p>I believe the latter can be achieved using this <a href="https://github.com/eileenmcnaughton/nz.co.fuzion.csvimport" rel="nofollow noreferrer">extension</a> (as in, it says it can import Line Items, but I have never had cause to use it. Seems you can use either the Contribution ID or the Trxn ID or the Invoice ID to run that import</p>
  <p><a href="https://i.sstatic.net/7fdYw.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7fdYw.png" alt="enter image description here" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-24T18:56:34.317Z
Answers.LastActivityDate: 2022-01-24T18:56:34.317Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <p>It appears that Transaction ID, Invoice ID and Credit ID are all designed to be unique on a per Contribution basis, and that this is by design.</p>
  <p>I suppose its a feature request on my part to have an option where they do not need to be unique.</p>
  <p>But in the meantime, the only solution is to make each Transaction ID unique somehow by adding additional text to it like &quot;1of2&quot; and &quot;2of2&quot;.</p>
  <p>Per Mick Kahn answer!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-23T02:26:11.780Z
Answers.LastActivityDate: 2022-01-23T02:26:11.780Z
Answers.UserDisplayName: jsherk
Body: <p>I am trying to import CSV file with a bunch of contributions that I have downloaded from Stripe, but it is requiring that Transaction ID and Invoice ID be unique across all Contributions.</p>
  <p>When creating the CSV file (using a script), I will create a seperate line for each item in an individual Stripe transaction.</p>
  <p>So if a single transaction on Stripe for $100 shows Building Fund $75 and General Fund $25, then in my CSV file that is generated, I create two seperate lines with basically all identical information except the Amount and the Financial Type. Since both these items come from the same Stripe transaction, they both have the same Transaction ID (I am using Stripe Charge ID for this).</p>
  <p>When I try to import the Contributions I get error log file with this:
  &quot;<em>Duplicate error - existing contribution record(s) have a matching Transaction ID or Invoice ID. Contribution record ID(s) are: 2</em>&quot;</p>
  <p>I am importing as INSERT NEW CONTRIBUTIONS and my mapping is match on EMAIL only (I have made sure there are not duplicate emails in my contacts).</p>
  <p>Has anybody else come across this issue?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-01-22T21:56:47.740Z
Comments.Text: i think the issue could be that you are talking about 'import contributions' but then you are talking about 'import line items'. i can't recall if this could help https://github.com/eileenmcnaughton/nz.co.fuzion.csvimport but i suspect that it would be a two step import. first contribution then line items. happy to learn i am wrong
Comments.UserDisplayName: petednz - fuzion
Tags: <civicontribute>
Title: Importing Contributions wont allow duplicate Transaction ID or Invoice ID - must be unique?
ThreadText: # Importing Contributions wont allow duplicate Transaction ID or Invoice ID - must be unique?
  
  (Asked by: username_0 on 2022-01-22)
  
  I am trying to import CSV file with a bunch of contributions that I have downloaded from Stripe, but it is requiring that Transaction ID and Invoice ID be unique across all Contributions.
  
  When creating the CSV file (using a script), I will create a seperate line for each item in an individual Stripe transaction.
  
  So if a single transaction on Stripe for $100 shows Building Fund $75 and General Fund $25, then in my CSV file that is generated, I create two seperate lines with basically all identical information except the Amount and the Financial Type. Since both these items come from the same Stripe transaction, they both have the same Transaction ID (I am using Stripe Charge ID for this).
  
  When I try to import the Contributions I get error log file with this:
  "*Duplicate error - existing contribution record(s) have a matching Transaction ID or Invoice ID. Contribution record ID(s) are: 2*"
  
  I am importing as INSERT NEW CONTRIBUTIONS and my mapping is match on EMAIL only (I have made sure there are not duplicate emails in my contacts).
  
  Has anybody else come across this issue?
  
  **Tags:** civicontribute
  
  > **Comments:**
  > **username_1**: i think the issue could be that you are talking about 'import contributions' but then you are talking about 'import line items'. i can't recall if this could help https://github.com/eileenmcnaughton/nz.co.username_1.csvimport but i suspect that it would be a two step import. first contribution then line items. happy to learn i am wrong  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_2 on 2022-01-22. Score: 1 | Accepted answer
  
  The error message says TransactionID or InvoiceID not AND as you say in your question.
  
  To get round this I would just edit your CSV so that you add a suffix "-1" "-2" etc to one of these fields where they would otherwise be the same. That way you can still see they are related when you look at them later.
  
  > **Comments:**
  > **username_0**: I was suggesting that the OR meant that it requires both the Transaction ID AND the Invoice ID to be unique, not from each other, but within their own fields.  
  > **username_2**: Reading the error message again I see that your interpretation is correct!  
  
  ---
  
  ### Answer by username_3 on 2022-01-23. Score: 0
  
  This is what line items are designed for. The contribution table will have $100 with the transaction id, invoice id etc with a financial type of X (we use Donation). Then the line item table has two entries. One for $75 for Building Fund and another entry of $25 for General Fund.
  In the import process this requires multiple imports. Once for the contribution table and once for the line item table.
  
  > **Comments:**
  > **username_0**: I do not see anything related to Import Contributions that allows me to add a line item or to import them as line items instead of just a single contribution. I do not even see any way to add a line item when manually using New Contribution or editing an exising contribution.  
  > **username_3**: I used https://civicrm.org/extensions/api-csv-import-gui  But you have to do it in two steps. Do the contribution import first. Then do the line item table and be sure that the contribution id is included.  
  
  ---
  
  ### Answer by username_1 on 2022-01-24. Score: 0
  
  As mentioned in my comment, this scenario would involve firstly importing the Contribution, then importing the Line Items.
  
  I believe the latter can be achieved using this [extension](https://github.com/eileenmcnaughton/nz.co.username_1.csvimport) (as in, it says it can import Line Items, but I have never had cause to use it. Seems you can use either the Contribution ID or the Trxn ID or the Invoice ID to run that import
  
  [![enter image description here](https://i.sstatic.net/7fdYw.png)](https://i.sstatic.net/7fdYw.png)
  
  
  ---
  
  ### Answer by username_0 on 2022-01-23. Score: 0
  
  It appears that Transaction ID, Invoice ID and Credit ID are all designed to be unique on a per Contribution basis, and that this is by design.
  
  I suppose its a feature request on my part to have an option where they do not need to be unique.
  
  But in the meantime, the only solution is to make each Transaction ID unique somehow by adding additional text to it like "1of2" and "2of2".
  
  Per username_2 username_2 answer!
  
  
  ---
  
  