# Add a Transaction Component

Components can either be of type `InternalSupplierComponent` or `DdsReferenceComponent`.

* **InternalSupplierComponent**: Use an `InternalSupplierComponent` to select the neccessary geolocation information from a supplier.
* **DdsReferenceComponent**: If the product was already part of a previous dds, it can be references using a `DdsReferenceComponent`.

## Create a component for a transaction.

> Create a new component for the specified transaction.

```json
{"openapi":"3.0.0","info":{"title":"TradeAware API","version":"0.43.0"},"servers":[{"url":"https://api.tradeaware.live-eo.com"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"CreateTransactionComponentDto":{"type":"object","properties":{"hsn":{"type":"string","description":"HS Code of the product. The HS code consists of at least six digits and is used by customs to classify the product being shipped."},"quantity":{"type":"number","description":"Quantity of the product, measured in the specified unit."},"unit":{"description":"Measurement unit of the product quantity. Can be one of: LTR, MTR, MTRSQR, MTRCUBE, KGM, TNE, PCS, PR, SET, PKG.","allOf":[{"$ref":"#/components/schemas/Unit"}]},"description":{"type":"string","description":"Short description of the product."},"namePairs":{"description":"The name pairs of the product.","default":[],"type":"array","items":{"$ref":"#/components/schemas/ComponentNamePairDto"}},"dateOfProduction":{"type":"string","description":"ISO 8601. The time at which the product was produced.,\n        For time ranges, also specify the endDateOfProduction."},"endDateOfProduction":{"type":"string","description":"ISO 8601. The time at which a time-ranged production was finalized."},"supplierBusinessId":{"type":"string","description":"Id of the supplier business for the transaction."},"supplierBusinessIds":{"description":"Ids of the supplier businesses for the transaction.","type":"array","items":{"type":"string"}},"plotIds":{"description":"A list of plot IDs to be associated with this component. Omit this field to attach all plots of the supplier business.","type":"array","items":{"type":"string"}},"ddsReferences":{"description":"Identifiers of the upstream DDS references.","type":"array","items":{"$ref":"#/components/schemas/DdsReferenceDto"}}},"required":["hsn","quantity","unit","description"]},"Unit":{"type":"string","enum":["LTR","MTR","MTRSQR","MTRCUBE","KGM","TNE","PCS","PR","SET","PKG"],"description":"Measurement unit of the product quantity."},"ComponentNamePairDto":{"type":"object","properties":{"commonName":{"type":"object","description":"The common name of the product.","nullable":true},"scientificName":{"type":"object","description":"The scientific name of the product.","nullable":true}},"required":["commonName","scientificName"]},"DdsReferenceDto":{"type":"object","properties":{"id":{"type":"string","description":"Reference number of the Due Diligence Statement."},"verificationNumber":{"type":"string","description":"Verification number of the Due Diligence Statement."}},"required":["id","verificationNumber"]},"GetComponentDto":{"type":"object","properties":{"id":{"type":"string","description":"id of this entity"},"hsn":{"type":"string","description":"HS Code of the product."},"commodity":{"description":"Commodity of the product.","allOf":[{"$ref":"#/components/schemas/Commodity"}]},"quantity":{"type":"number","description":"Quantity of the product, measured in the specified unit."},"unit":{"description":"Measurement unit of the product quantity.","allOf":[{"$ref":"#/components/schemas/Unit"}]},"description":{"type":"string","description":"Short description of the product."},"namePairs":{"description":"The common and scientific names of the product.","type":"array","items":{"$ref":"#/components/schemas/ComponentNamePairDto"}},"transactionId":{"type":"string","description":"Id of the transaction that this component belongs to"},"dateOfProduction":{"type":"string","description":"ISO 8601. The time at which the product was produced., \n        Can be a time range if endDateOfProduction is specified."},"endDateOfProduction":{"type":"string","description":"ISO 8601. The time at which a time-ranged production was finalized."},"createdAt":{"type":"string","description":"ISO 8601"},"updatedAt":{"type":"string","description":"ISO 8601"},"supplierBusiness":{"description":"Supplier business of this product","allOf":[{"$ref":"#/components/schemas/GetBusinessDto"}]},"supplierBusinesses":{"description":"Supplier businesses of this product","type":"array","items":{"$ref":"#/components/schemas/GetBusinessDto"}},"plotIds":{"description":"Ids of the plots associated with this component.","type":"array","items":{"type":"string"}},"ddsReferences":{"description":"Identifiers of the upstream DDS references.","type":"array","items":{"$ref":"#/components/schemas/DdsReferenceDto"}}},"required":["id","hsn","commodity","quantity","unit","description","namePairs","transactionId","createdAt","updatedAt","ddsReferences"]},"Commodity":{"type":"string","enum":["cattle","cocoa","coffee","oil palm","rubber","soya","timber"],"description":"What crops (among the relevant commodities) are grown on this field (currently)."},"GetBusinessDto":{"type":"object","properties":{"id":{"type":"string","description":"id of this entity"},"email":{"type":"string","description":"email of the contact person in the business","nullable":true},"name":{"type":"string","description":"business's name","nullable":true},"username":{"type":"string","description":"Business's username","nullable":true},"addressStreet":{"type":"string","description":"street address of the business","nullable":true},"addressZip":{"type":"string","description":"country-specific area code or zip code of the business's address","nullable":true},"addressPostcode":{"type":"string","description":"country-specific postcode of the business's address","nullable":true},"addressArea":{"type":"string","description":"country region of the business's address","nullable":true},"addressCity":{"type":"string","description":"city of the business's address","nullable":true},"addressCountryCode":{"type":"string","description":"two-letter country code (ISO 3166 Alpha-2) of the business's address","nullable":true},"addressCountry":{"type":"string","description":"Country of the business's address","nullable":true},"addressLine1":{"type":"string","description":"first line of the business address","nullable":true},"addressLine2":{"type":"string","description":"second line of the business address","nullable":true},"createdAt":{"type":"string","description":"ISO 8601"},"updatedAt":{"type":"string","description":"ISO 8601"},"initialLocale":{"type":"object","description":"Locale that is used for the invitation email sent to the business"},"units":{"type":"string","description":"units of measurement used by the application"},"plots":{"description":"IMPORTANT: only set when 'plots' is provided in 'includes'. List of plots owned by the business","type":"array","items":{"$ref":"#/components/schemas/GetPlotFullDto"}},"newlyCreated":{"type":"boolean","default":true,"description":"whether the business was created recently"},"members":{"description":"users members of the business","type":"array","items":{"$ref":"#/components/schemas/GetUserDto"}},"connectionsAsSource":{"description":"connections where the business is the source","type":"array","items":{"$ref":"#/components/schemas/GetBusinessConnectionDto"}},"connectionsAsTarget":{"description":"connections where the business is the target","type":"array","items":{"$ref":"#/components/schemas/GetBusinessConnectionDto"}},"businessInvitations":{"description":"invitations sent by the business","type":"array","items":{"$ref":"#/components/schemas/GetBusinessInvitationDto"}},"contactPerson":{"description":"contact person of business","nullable":true,"allOf":[{"$ref":"#/components/schemas/GetUserDto"}]},"machineToMachineClientId":{"type":"string","description":"The machine-to-machine client created by user","nullable":true},"eori":{"type":"string","description":"EORI number of the business","nullable":true},"vat":{"type":"string","description":"VAT number of the business","nullable":true},"tracesEnvironment":{"type":"string","enum":["ACCEPTANCE","PRODUCTION"],"description":"The TRACES environment configured for the business. ACCEPTANCE for testing, PRODUCTION for live submissions."}},"required":["id","email","name","createdAt","updatedAt","initialLocale","newlyCreated","eori","vat"]},"GetPlotFullDto":{"type":"object","properties":{"id":{"type":"string","description":"id of this entity"},"createdAt":{"type":"string","description":"ISO 8601"},"updatedAt":{"type":"string","description":"ISO 8601"},"suppliers":{"description":"The suppliers of the plot with respect to the current business.\n    May be multiple if the plot is reachable in the supply chain\n    via multiple different direct suppliers of the current business.","type":"array","items":{"$ref":"#/components/schemas/GetBusinessDto"}},"geometry":{"oneOf":[{"$ref":"#/components/schemas/GetPolygonDto"},{"$ref":"#/components/schemas/GetMultiPolygonDto"}],"description":"The geometry of the plot."},"commodities":{"type":"array","description":"What crops (among the relevant commodities) are grown on this field (currently).","items":{"$ref":"#/components/schemas/Commodity"}},"name":{"type":"string","description":"Free text name of the plot. Useful for easily finding and identifying the plot as an enduser."},"surfaceArea":{"type":"number","description":"Surface area in square meters"},"countryCode":{"type":"string","description":"ISO 3166-1 alpha-2 country code of where the plot is located"},"mostRecentAnalysis":{"description":"The latest analysis of this plot by createdAt.\n      IMPORTANT: only set when 'mostRecentAnalysis' is provided in\n      'includes'. If no analysis on this plot is available yet, this\n      property may be missing even when provided in 'includes'.","allOf":[{"$ref":"#/components/schemas/GetAnalysisFullDto"}]},"mostRecentAnalysesByType":{"description":"The latest analyses of this plot by createdAt.\n      Contains one analysis per analysis type, or null if no analysis of that type is available.","allOf":[{"$ref":"#/components/schemas/GetMostRecentAnalysesFullDto"}]},"riskAssessmentStatus":{"description":"The risk assessment status of this plot set by your business","allOf":[{"$ref":"#/components/schemas/PlotRiskAssessmentStatus"}]},"riskLevel":{"type":"string","enum":["none","low","medium","high"],"nullable":true,"description":"The risk level of deforestation in this plot.\n      IMPORTANT: only set when 'riskLevel' is provided in 'includes'.\n      If no analysis on this plot is available yet, this property may be null."},"filename":{"type":"object","description":"Filename of the plot. Useful to know where is the Plot coming from on batch create.","nullable":true},"description":{"type":"string","description":"Free text descrption of the plot. Useful for to keep human friendly Plot names.","nullable":true},"ownerId":{"type":"string","description":"The id of the owning business. May be undefined for supplier masking."},"customData":{"type":"object","description":"A customizable metadata field for storing additional information related to a plot in TradeAware.\n      This field allows customers to associate their own identifiers or data with TradeAware's system.\n\n      The `customData` field is returned unchanged and is visible only to the owners of the plot.\n\n      Constraints:\n        - Up to 10 keys per object\n        - Key length: Maximum 255 characters\n        - String value length: Maximum 255 characters\n        - Values must be of type: string, number, or boolean\n        - Nested objects are not allowed\n        - Keys cannot contain: '__proto__', 'constructor', or 'prototype'\n      "}},"required":["id","createdAt","updatedAt","geometry","commodities","name","surfaceArea","countryCode"]},"GetPolygonDto":{"type":"object","properties":{"type":{"type":"string","description":"The type of geometry. Always 'Polygon' for polygons"},"coordinates":{"type":"array","description":"A Polygon's coordinates. Three-dimensional number array. Should follow https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.6","items":{"type":"array","items":{"type":"array","items":{"type":"number"}}}}},"required":["type","coordinates"]},"GetMultiPolygonDto":{"type":"object","properties":{"type":{"type":"string","description":"The type of geometry. Always 'MultiPolygon' for multipolygons"},"coordinates":{"type":"array","description":"A MultiPolygon's coordinates. Four-dimensional number array. Should follow https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.7","items":{"type":"array","items":{"type":"array","items":{"type":"array","items":{"type":"number"}}}}}},"required":["type","coordinates"]},"GetAnalysisFullDto":{"type":"object","properties":{"id":{"type":"string","description":"Id of this analysis"},"createdAt":{"type":"string","description":"ISO 8601"},"updatedAt":{"type":"string","description":"ISO 8601"},"status":{"description":"The overall status of the underlying analysis pipeline","allOf":[{"$ref":"#/components/schemas/AnalysisStatus"}]},"plotId":{"type":"string","description":"Id of the plot that this analysis belongs to and is performed on"},"analysedAt":{"type":"string","description":"ISO 8601"},"version":{"type":"string","description":"The version of the analysis pipeline that was run"},"deforestedArea":{"type":"number","description":"The deforested area in square meters"},"deforestedGeometry":{"description":"The deforested area as a GeoJSON Polygon","oneOf":[{"$ref":"#/components/schemas/GetPolygonDto"},{"$ref":"#/components/schemas/GetMultiPolygonDto"}]},"riskOfDeforestation":{"type":"number","description":"The risk of deforestation in this area. 0.0 is no risk, 1.0 is certain deforestation."},"type":{"description":"The type of analysis that was requested","allOf":[{"$ref":"#/components/schemas/AnalysisType"}]},"customData":{"type":"object","description":"Additional custom data. We don't use it for any calculations."},"metadata":{"type":"object","description":"Additional metadata. We don't use it for any calculations.\n      This field is deprecated and will be removed in the future. Please use\n      customData instead.","deprecated":true},"name":{"type":"string","description":"A human-friendly name for this analysis"}},"required":["id","createdAt","updatedAt","status","plotId","type"]},"AnalysisStatus":{"type":"string","enum":["PENDING","RUNNING","SUCCEEDED","FAILED"],"description":"The overall status of the underlying analysis pipeline"},"AnalysisType":{"type":"string","enum":["OS","EUFOROBS","PRECISION"],"description":"The type of analysis that was requested"},"GetMostRecentAnalysesFullDto":{"type":"object","properties":{"EUFOROBS":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/GetAnalysisFullDto"}]},"PRECISION":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/GetAnalysisFullDto"}]}},"required":["EUFOROBS","PRECISION"]},"PlotRiskAssessmentStatus":{"type":"string","enum":["NEW","UNDER_REVIEW","IN_RISK_MITIGATION","EUDR_COMPLIANT","EUDR_NON_COMPLIANT"],"description":"The risk assessment status of this plot set by your business"},"GetUserDto":{"type":"object","properties":{"auth0UserId":{"type":"string","description":"id of this entity, ref to auth0"},"business":{"description":"business that this user is member of","allOf":[{"$ref":"#/components/schemas/GetBusinessDto"}]},"businessId":{"type":"string","description":"business id that this user is member of"},"firstName":{"type":"string","description":"first name of user"},"lastName":{"type":"string","description":"last name of user"},"locale":{"type":"string","description":"locale that is used for the invitation email sent to the user"},"createdAt":{"type":"string","description":"ISO 8601"},"updatedAt":{"type":"string","description":"ISO 8601"},"completed":{"type":"boolean","default":false,"description":"is onboarding process completed"},"businessInvitations":{"description":"business invitations with relation to","type":"array","items":{"$ref":"#/components/schemas/GetBusinessInvitationDto"}},"userInvitations":{"description":"user invitations with relation to","type":"array","items":{"$ref":"#/components/schemas/GetUserInvitationDto"}},"email":{"type":"string","description":"email of the user"},"consentedAt":{"type":"string","description":"ISO 8601 Date when user consented to terms and conditions. If undefined, then consent has not been given"},"entitlements":{"default":{"canTriggerPrecisionAnalysis":false},"description":"Entitlements of the user, e.g. can trigger precision analysis","allOf":[{"$ref":"#/components/schemas/GetEntitlementsDto"}]}},"required":["auth0UserId","locale","createdAt","updatedAt","completed","entitlements"]},"GetBusinessInvitationDto":{"type":"object","properties":{"id":{"type":"string","description":"id of this entity"},"sentByUser":{"description":"user that sent this invitation","allOf":[{"$ref":"#/components/schemas/GetUserDto"}]},"business":{"description":"business that this invitation is for","allOf":[{"$ref":"#/components/schemas/GetBusinessDto"}]},"email":{"type":"string","description":"email of the user that this invitation is for"},"status":{"description":"status of this invitation","allOf":[{"$ref":"#/components/schemas/BusinessInvitationStatus"}]},"createdAt":{"type":"string","description":"date this entity was created"},"updatedAt":{"type":"string","description":"date this entity was last updated"},"sourceIsInvitee":{"type":"boolean","description":"describes if the invited business will share or receive data"},"customData":{"type":"object","description":"A customizable metadata field for storing additional information related to a business invitation in TradeAware.\n      This field allows customers to associate their own identifiers or data with TradeAware's system.\n\n      The `customData` field is returned unchanged and is visible only to the owners of the business invitation.\n\n      Constraints:\n        - Up to 10 keys per object\n        - Key length: Maximum 255 characters\n        - String value length: Maximum 255 characters\n        - Values must be of type: string, number, or boolean\n        - Nested objects are not allowed\n        - Keys cannot contain: '__proto__', 'constructor', or 'prototype'\n      "}},"required":["id","sentByUser","email","status","createdAt","updatedAt","sourceIsInvitee"]},"BusinessInvitationStatus":{"type":"string","enum":["PENDING","ACCEPTED","REJECTED","EXPIRED","CANCELLED"],"description":"status of this invitation"},"GetUserInvitationDto":{"type":"object","properties":{"id":{"type":"string","description":"id of this entity"},"email":{"type":"string","description":"email of the user that this invitation is for"},"sentByUser":{"description":"user that sent this invitation","allOf":[{"$ref":"#/components/schemas/GetUserDto"}]},"inviteToBusiness":{"description":"business from which this invitation was sent","allOf":[{"$ref":"#/components/schemas/GetBusinessDto"}]},"status":{"description":"status of this invitation","allOf":[{"$ref":"#/components/schemas/UserInvitationStatus"}]},"createdAt":{"type":"string","description":"date this entity was created"},"updatedAt":{"type":"string","description":"date this entity was last updated"}},"required":["id","email","sentByUser","inviteToBusiness","status","createdAt","updatedAt"]},"UserInvitationStatus":{"type":"string","enum":["ACCEPTED","CANCELLED","EXPIRED","PENDING","REJECTED"],"description":"status of this invitation"},"GetEntitlementsDto":{"type":"object","properties":{"canTriggerPrecisionAnalysis":{"type":"boolean","default":false,"description":"Indicates whether the user can request precision analysis for a plot"},"canManageTransactions":{"type":"boolean","default":false,"description":"Indicates whether the user can manage transactions"},"canViewSurveys":{"type":"boolean","default":false,"description":"Indicates whether the user can view surveys"},"canViewOwnedSurveyResponses":{"type":"boolean","default":true,"description":"Indicates whether the user can view the survey responses owned by their business"},"canViewSurveyResponsesOfTier1Suppliers":{"type":"boolean","default":false,"description":"Indicates whether the user can view the survey responses of their tier-1 suppliers"},"canMutateOwnedSurveyResponses":{"type":"boolean","default":false,"description":"Indicates whether the user can update or delete survey responses or create a new survey response owned by their business"},"canDownloadSurveyResponses":{"type":"boolean","default":false,"description":"Indicates whether the user can download their own survey responses or the completed survey responses of their tier-1 suppliers"},"canManageWebhooks":{"type":"boolean","default":false,"description":"Indicates whether the user can manage webhooks"},"canAccessApi":{"type":"boolean","default":false,"description":"Indicates whether the user has programmatic access to the API"},"canManageCmsSupplierRiskAssessmentStatuses":{"type":"boolean","default":false,"description":"Indicates whether the user can manage CMS supplier risk assessment statuses"}},"required":["canTriggerPrecisionAnalysis","canManageTransactions","canViewSurveys","canViewOwnedSurveyResponses","canViewSurveyResponsesOfTier1Suppliers","canMutateOwnedSurveyResponses","canDownloadSurveyResponses","canManageWebhooks","canAccessApi","canManageCmsSupplierRiskAssessmentStatuses"]},"GetBusinessConnectionDto":{"type":"object","properties":{"id":{"type":"string","description":"id of this entity"},"sourceBusiness":{"description":"source business of this connection","allOf":[{"$ref":"#/components/schemas/GetBusinessDto"}]},"targetBusiness":{"description":"target business of this connection","allOf":[{"$ref":"#/components/schemas/GetBusinessDto"}]},"createdAt":{"type":"string","description":"date that this connection was created"},"updatedAt":{"type":"string","description":"date that this connection was last updated"},"customData":{"type":"object","description":"metadata for this business connection. Only visible to the buyer who set this."},"plotsCount":{"type":"number","description":"Total number of plots in this supplier's supply chain","default":0},"plotsCommodities":{"description":"List of all commodities produced in this supplier's supply chain","type":"array","items":{"type":"string"}}},"required":["id","sourceBusiness","targetBusiness","createdAt","updatedAt","customData","plotsCount","plotsCommodities"]}}},"paths":{"/transactions/{id}/components":{"post":{"description":"Create a new component for the specified transaction.","operationId":"TransactionComponentsController_createComponent","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTransactionComponentDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetComponentDto"}}}},"400":{"description":""},"401":{"description":""},"403":{"description":""}},"summary":"Create a component for a transaction.","tags":["Components"]}}}}
```
