Create and apply cash application
curl --request POST \
--url https://api.entendre.finance/v1/cash-applications \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-API-Key: <api-key>' \
--data '
{
"deposit_transaction_id": "txn_507f1f77bcf86cd799439011",
"allocations": [
{
"target_type": "invoice",
"target_id": "inv_507f1f77bcf86cd799439011",
"amount": "100.00"
}
],
"compiled_rules": []
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
deposit_transaction_id: 'txn_507f1f77bcf86cd799439011',
allocations: [
{
target_type: 'invoice',
target_id: 'inv_507f1f77bcf86cd799439011',
amount: '100.00'
}
],
compiled_rules: []
})
};
fetch('https://api.entendre.finance/v1/cash-applications', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.entendre.finance/v1/cash-applications"
payload = {
"deposit_transaction_id": "txn_507f1f77bcf86cd799439011",
"allocations": [
{
"target_type": "invoice",
"target_id": "inv_507f1f77bcf86cd799439011",
"amount": "100.00"
}
],
"compiled_rules": []
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "ca_507f1f77bcf86cd799439011",
"organization_id": "org_507f1f77bcf86cd799439011",
"legal_entity_id": "le_507f1f77bcf86cd799439011",
"deposit_transaction_id": "txn_507f1f77bcf86cd799439011",
"status": "applied",
"stripe_status": "pending",
"match_type": "exact",
"total_amount": "100.00",
"applied_amount": "100.00",
"unapplied_amount": "0.00",
"deposit_memo": null,
"txn_date": null,
"allocations": [
{
"target_type": "invoice",
"target_id": "inv_507f1f77bcf86cd799439011",
"invoice_number": "INV-100",
"amount": "100.00",
"customer_name": "Example Customer"
}
],
"applied_by": null,
"journal_entry_id": "je_507f1f77bcf86cd799439011",
"stripe_marked_paid_at": null,
"confirmed_by": null,
"confirmed_at": null,
"created_at": null,
"updated_at": null,
"error_message": null,
"etag": "\"v_example\""
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid path, query or request body.",
"request_id": "req_example"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication is required.",
"request_id": "req_example"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Insufficient access to organization",
"request_id": "req_example"
}
}{
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Resource not found",
"request_id": "req_example"
}
}{
"error": {
"code": "CONFLICT",
"message": "The resource state does not allow this operation.",
"request_id": "req_example"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded. Retry after 30s.",
"request_id": "req_example"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal server error",
"request_id": "req_example"
}
}{
"error": {
"code": "SERVICE_UNAVAILABLE",
"message": "Service unavailable.",
"request_id": "req_example"
}
}Cash Application
Create and apply cash application
Creates and applies a cash application, and posts its accounting entries.
POST
/
v1
/
cash-applications
Create and apply cash application
curl --request POST \
--url https://api.entendre.finance/v1/cash-applications \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-API-Key: <api-key>' \
--data '
{
"deposit_transaction_id": "txn_507f1f77bcf86cd799439011",
"allocations": [
{
"target_type": "invoice",
"target_id": "inv_507f1f77bcf86cd799439011",
"amount": "100.00"
}
],
"compiled_rules": []
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
deposit_transaction_id: 'txn_507f1f77bcf86cd799439011',
allocations: [
{
target_type: 'invoice',
target_id: 'inv_507f1f77bcf86cd799439011',
amount: '100.00'
}
],
compiled_rules: []
})
};
fetch('https://api.entendre.finance/v1/cash-applications', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.entendre.finance/v1/cash-applications"
payload = {
"deposit_transaction_id": "txn_507f1f77bcf86cd799439011",
"allocations": [
{
"target_type": "invoice",
"target_id": "inv_507f1f77bcf86cd799439011",
"amount": "100.00"
}
],
"compiled_rules": []
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "ca_507f1f77bcf86cd799439011",
"organization_id": "org_507f1f77bcf86cd799439011",
"legal_entity_id": "le_507f1f77bcf86cd799439011",
"deposit_transaction_id": "txn_507f1f77bcf86cd799439011",
"status": "applied",
"stripe_status": "pending",
"match_type": "exact",
"total_amount": "100.00",
"applied_amount": "100.00",
"unapplied_amount": "0.00",
"deposit_memo": null,
"txn_date": null,
"allocations": [
{
"target_type": "invoice",
"target_id": "inv_507f1f77bcf86cd799439011",
"invoice_number": "INV-100",
"amount": "100.00",
"customer_name": "Example Customer"
}
],
"applied_by": null,
"journal_entry_id": "je_507f1f77bcf86cd799439011",
"stripe_marked_paid_at": null,
"confirmed_by": null,
"confirmed_at": null,
"created_at": null,
"updated_at": null,
"error_message": null,
"etag": "\"v_example\""
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid path, query or request body.",
"request_id": "req_example"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication is required.",
"request_id": "req_example"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Insufficient access to organization",
"request_id": "req_example"
}
}{
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Resource not found",
"request_id": "req_example"
}
}{
"error": {
"code": "CONFLICT",
"message": "The resource state does not allow this operation.",
"request_id": "req_example"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded. Retry after 30s.",
"request_id": "req_example"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal server error",
"request_id": "req_example"
}
}{
"error": {
"code": "SERVICE_UNAVAILABLE",
"message": "Service unavailable.",
"request_id": "req_example"
}
}Send the deposit, the invoice allocations and the current
compiled_rules from organization memory. Entendre checks eligibility and invoice balances again; a preview does not reserve funds.Authorizations
Your organization API key. Some operations also need a key that is associated with a user; their pages say so.
Headers
Unique key for this operation. Retry with the same key and request body after a timeout. Keys are retained for at least 24 hours.
Required string length:
1 - 255Body
application/json
Deposit transaction (txn_…).
Invoice allocations.
Required array length:
1 - 100 elementsShow child attributes
Show child attributes
Current routing rules from organization memory. Supply [] only to explicitly use default routing.
Show child attributes
Show child attributes
Optional lac_… for the adjustment leg. Defaults to the organization's cash-application adjustment account.
Response
Created.
A deposit and the invoices that it pays.
Show child attributes
Show child attributes