# Transactions

## Create a transaction for a person

> \
> This endpoint creates a transaction for a person, if your service account allows you to.\
> \
> The person you are allowed to create a transaction for is also limited by your service account.\
> \
> We advice you to provide your own 'uuid' value, as you can use this as a mechanism to ensure the transaction is only created once. When accidentally the transaction is posted twice, the uuid will ensure it is only saved the first time, and a 409 CONFLICT status will be returned when posted a second time with the same uuid. When you don't supply a uuid, the system will generate one for you, which will be returned in the response body.\
> \
> This endpoint will return the created transaction in the response body.\
> \
> \## Determining where the transaction will be managed\
> \
> When creating a transaction through the API, you need to determine where the transaction will be managed. You can do this by supplying or not supplying an \`externalSource\`-property in the request body. Based upon the value of this property, different input validation and domain rules apply. \
> \
> When you don't supply an external source, we consider the transaction to be primarily managed in TapRaise.app, and it needs to adhere to TapRaise's domain rules that are there to ensure it's validity and quality. \
> \
> When you supply an external source, we consider the transaction to be primarily managed at that source, and do NOT apply the domain rules we apply on transactions managed in TapRaise. We consider it as external data that cannot be updated in TapRaise.app.\
> \
> Be sure to check the descriptions for fields in the request body to see which fields are required, optional or forbidden for each scenario.<br>

```json
{"openapi":"3.0.0","info":{"title":"TapRaise API","version":"v1"},"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"jwt","type":"http"}},"schemas":{"CreateTransactionInput":{"type":"object","properties":{"uuid":{"type":"string","format":"uuid","description":"UUID (v4). The transaction's globally unique identifier in the system. If not provided, a new UUID will be generated."},"externalSource":{"default":null,"description":"When provided the transaction is considered to be managed in this external system, and the transaction is not editable in TapRaise and does not need to adhere to the TapRaise domain rules. See the general description of this endpoint for more information.","allOf":[{"$ref":"#/components/schemas/ExternalSourceInput"}]},"personUuid":{"type":"string","format":"uuid","description":"UUID (v4) of the person that made this transaction."},"origin":{"description":"This field requires you to connect the transaction to an origin, for example pledge case.","allOf":[{"$ref":"#/components/schemas/TransactionOriginInput"}]},"amount":{"type":"number","description":"Transaction amount. Only supporting Euros at this point."},"name":{"type":"string","description":"Name of the person that made this transaction at the moment in time. Might also be used for the name of the bank account holder."},"iban":{"type":"string","description":"IBAN of the bank account that made this transaction."},"description":{"type":"string","description":"Description of the transaction, usually provided by the payment initiator."},"provider":{"type":"string","enum":["cm","mollie"],"description":"Identifier of the payment provider used for this transaction."},"method":{"type":"string","enum":["idealqr"],"description":"Payment method used for this transaction."},"referenceId":{"type":"string","description":"Reference id provided by the payment initiator."},"transactionId":{"type":"string","description":"Transaction id provided by the payment provider."},"providerMetadata":{"type":"object","description":"Meta data provided by/about the payment provider."},"createdAt":{"type":"string","description":"Date of transaction creation, formatted as ISO8601 date string."},"status":{"type":"string","enum":["open","paid","failed","cancelled","reversed"],"description":"\nThe current status of the transaction:\n* `open` → open transaction, to be paid.\n* `paid` → paid transaction.\n* `failed` → failed transaction before it was paid.\n* `cancelled` → cancelled transaction before it was paid.\n* `reversed` → reversed transaction or chargeback."}},"required":["personUuid","origin","amount","name","iban","description","provider","method","createdAt","status"]},"ExternalSourceInput":{"type":"object","properties":{"name":{"type":"string","description":"The description of the external source"},"identifier":{"type":"string","description":"The unique identifier of the pledge in the external source"}},"required":["name","identifier"]},"TransactionOriginInput":{"type":"object","properties":{"name":{"type":"string","enum":["pledgeCase"]},"identifier":{"type":"string","format":"uuid","description":"UUID (v4)"}},"required":["name","identifier"]},"TransactionDto":{"type":"object","properties":{"uuid":{"type":"string","format":"uuid","description":"UUID (v4)"},"personUuid":{"type":"string","format":"uuid","description":"UUID (v4)"},"origin":{"description":"This field requires you to connect the transaction to an origin, for example pledge case.","allOf":[{"$ref":"#/components/schemas/TransactionOriginDto"}]},"amount":{"type":"number","description":"Transaction amount. Only supporting Euros at this point."},"name":{"type":"string","description":"Name of the person that made this transaction at the moment in time. Might also be used for the name of the bank account holder.","nullable":true},"iban":{"type":"string","description":"IBAN of the bank account that made this transaction.","nullable":true},"description":{"type":"string","description":"Description of the transaction, usually provided by the payment initiator."},"provider":{"type":"string","enum":["cm","mollie"],"description":"Identifier of the payment provider used for this transaction.","nullable":true},"method":{"type":"string","enum":["idealqr","direct_debit"],"description":"Payment method used for this transaction.","nullable":true},"referenceId":{"type":"string","description":"Reference id provided by the payment initiator.","nullable":true},"transactionId":{"type":"string","description":"Transaction id provided by the payment provider.","nullable":true},"providerMetadata":{"type":"object","description":"Meta data provided by/about the payment provider.","nullable":true},"createdAt":{"format":"date-time","type":"string","description":"Date of transaction creation, formatted as ISO8601 date string."},"updatedAt":{"format":"date-time","type":"string","description":"Date of transaction last update, formatted as ISO8601 date string."},"status":{"type":"string","enum":["open","paid","failed","cancelled","reversed"],"description":"\nThe current status of the transaction:\n* `open` → open transaction, to be paid.\n* `paid` → paid transaction.\n* `failed` → failed transaction before it was paid.\n* `cancelled` → cancelled transaction before it was paid.\n* `reversed` → reversed transaction or chargeback."}},"required":["uuid","personUuid","origin","amount","description","createdAt","updatedAt","status"]},"TransactionOriginDto":{"type":"object","properties":{"name":{"type":"string","enum":["pledgeCase"]},"identifier":{"type":"string","format":"uuid","description":"UUID (v4)"}},"required":["name","identifier"]}}},"paths":{"/api/v1/transactions":{"post":{"operationId":"CreateTransactionRestController_create","summary":"Create a transaction for a person","description":"\nThis endpoint creates a transaction for a person, if your service account allows you to.\n\nThe person you are allowed to create a transaction for is also limited by your service account.\n\nWe advice you to provide your own 'uuid' value, as you can use this as a mechanism to ensure the transaction is only created once. When accidentally the transaction is posted twice, the uuid will ensure it is only saved the first time, and a 409 CONFLICT status will be returned when posted a second time with the same uuid. When you don't supply a uuid, the system will generate one for you, which will be returned in the response body.\n\nThis endpoint will return the created transaction in the response body.\n\n## Determining where the transaction will be managed\n\nWhen creating a transaction through the API, you need to determine where the transaction will be managed. You can do this by supplying or not supplying an `externalSource`-property in the request body. Based upon the value of this property, different input validation and domain rules apply. \n\nWhen you don't supply an external source, we consider the transaction to be primarily managed in TapRaise.app, and it needs to adhere to TapRaise's domain rules that are there to ensure it's validity and quality. \n\nWhen you supply an external source, we consider the transaction to be primarily managed at that source, and do NOT apply the domain rules we apply on transactions managed in TapRaise. We consider it as external data that cannot be updated in TapRaise.app.\n\nBe sure to check the descriptions for fields in the request body to see which fields are required, optional or forbidden for each scenario.\n","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTransactionInput"}}}},"responses":{"201":{"description":"Transaction was created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionDto"}}}},"400":{"description":"Bad request. Response body shows what the problem is."},"401":{"description":"Service account not properly authenticated"},"403":{"description":"Service account forbids executing this action"},"409":{"description":"Transaction already exists"}},"tags":["transactions"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.tapraise.com/api/api-reference/transactions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
