Transactions
Expenses are positive, income is negative. Transfers should set isTransfer and point at transferToAccountId. Use upsert for sync-safe transaction ingestion.
`POST` and `PATCH` requests require an Idempotency-Key header. Responses return
an X-Request-Id header plus X-RateLimit-* headers, and errors follow
application/problem+json.
/v1/transactions List transactions
Example
curl -X GET "https://api.duitmyself.app/v1/transactions" \
-H "Authorization: Bearer key_..." \ Response schema · TransactionListResponse
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Transaction"
}
},
"nextCursor": {
"type": [
"string",
"null"
]
},
"hasMore": {
"type": "boolean"
}
},
"required": [
"data",
"nextCursor",
"hasMore"
]
} /v1/transactions Create a transaction
Example
curl -X POST "https://api.duitmyself.app/v1/transactions" \
-H "Authorization: Bearer key_..." \
-H "Idempotency-Key: demo-post" \
-H "Content-Type: application/json" \
-d '"TransactionCreate"' Request schema · TransactionCreate
{
"$ref": "#/definitions/TransactionCreate",
"definitions": {
"TransactionCreate": {
"type": "object",
"properties": {
"externalId": {
"type": "string"
},
"accountId": {
"type": "string"
},
"categoryId": {
"type": "string"
},
"payeeId": {
"type": "string"
},
"payeeName": {
"type": "string"
},
"amount": {
"type": "number"
},
"date": {
"type": "string"
},
"note": {
"type": "string"
},
"time": {
"type": "string"
},
"isTransfer": {
"type": "boolean"
},
"transferToAccountId": {
"type": "string"
},
"destinationAmount": {
"type": "number"
},
"exchangeRate": {
"type": "number"
}
},
"required": [
"accountId",
"amount",
"date"
],
"additionalProperties": false
}
}
} Response schema · TransactionResponse
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/Transaction"
}
},
"required": [
"data"
]
} /v1/transactions/{transactionId} Get a transaction
Parameters
-
transactionIdinpath
Example
curl -X GET "https://api.duitmyself.app/v1/transactions/{transactionId}" \
-H "Authorization: Bearer key_..." \ Response schema · TransactionResponse
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/Transaction"
}
},
"required": [
"data"
]
} /v1/transactions/{transactionId} Update a transaction
Parameters
-
transactionIdinpath
Example
curl -X PATCH "https://api.duitmyself.app/v1/transactions/{transactionId}" \
-H "Authorization: Bearer key_..." \
-H "Idempotency-Key: demo-patch" \
-H "Content-Type: application/json" \
-d '"TransactionUpdate"' Request schema · TransactionUpdate
{
"$ref": "#/definitions/TransactionUpdate",
"definitions": {
"TransactionUpdate": {
"type": "object",
"properties": {
"externalId": {
"type": "string",
"nullable": true
},
"accountId": {
"type": "string"
},
"categoryId": {
"type": "string",
"nullable": true
},
"payeeId": {
"type": "string",
"nullable": true
},
"payeeName": {
"type": "string"
},
"amount": {
"type": "number"
},
"date": {
"type": "string"
},
"note": {
"type": "string"
},
"time": {
"type": "string",
"nullable": true
},
"isTransfer": {
"type": "boolean"
},
"transferToAccountId": {
"type": "string",
"nullable": true
},
"destinationAmount": {
"type": "number"
},
"exchangeRate": {
"type": "number"
}
},
"additionalProperties": false
}
}
} Response schema · TransactionResponse
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/Transaction"
}
},
"required": [
"data"
]
} /v1/transactions/{transactionId} Delete a transaction
Parameters
-
transactionIdinpath
Example
curl -X DELETE "https://api.duitmyself.app/v1/transactions/{transactionId}" \
-H "Authorization: Bearer key_..." \ /v1/transactions/upsert Create or update a transaction by external ID
Example
curl -X POST "https://api.duitmyself.app/v1/transactions/upsert" \
-H "Authorization: Bearer key_..." \
-H "Idempotency-Key: demo-post" \
-H "Content-Type: application/json" \
-d '"TransactionUpsert"' Request schema · TransactionUpsert
{
"$ref": "#/definitions/TransactionUpsert",
"definitions": {
"TransactionUpsert": {
"type": "object",
"properties": {
"externalId": {
"type": "string"
},
"accountId": {
"type": "string"
},
"categoryId": {
"type": "string"
},
"payeeId": {
"type": "string"
},
"payeeName": {
"type": "string"
},
"amount": {
"type": "number"
},
"date": {
"type": "string"
},
"note": {
"type": "string"
},
"time": {
"type": "string"
},
"isTransfer": {
"type": "boolean"
},
"transferToAccountId": {
"type": "string"
},
"destinationAmount": {
"type": "number"
},
"exchangeRate": {
"type": "number"
}
},
"required": [
"externalId",
"accountId",
"amount",
"date"
],
"additionalProperties": false
}
}
} Response schema · TransactionUpsertResponse
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"enum": [
"created",
"updated"
]
},
"data": {
"$ref": "#/components/schemas/Transaction"
}
},
"required": [
"operation",
"data"
]
}