Create a credit card entry
Operation ID: createCreditCardEntry
Group: Banking › Credit Card Entries
Open in the interactive reference
POST /banking/credit-card-entries
Retry-safe: A write that accepts Idempotency-Key: repeating a request with the same key replays the stored answer instead of executing twice.
Creates a credit card entry with its lines. If the accounting period that contains transactionDate is closed or locked in every full accounting book of the legal entity, the entry goes into the next period that is open in all of them, up to 11 periods later. If none of those periods is open in every book, or a period is open in some books and closed in others, the request fails with POSTING_PERIOD_NOT_OPEN.
The response contains only the new entry's id. Read the record with GET banking/credit-card-entries/:id.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Api-Version |
header | string · v1 | yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version v1. |
Idempotency-Key |
header | string | no | An opaque caller-chosen string (1-255 characters) that makes this request safe to retry. Repeating the same key with an identical request body replays the original response instead of re-executing - but only once that original request succeeded; a failed attempt re-executes on retry. Repeating the key with a different body is answered with 422. A key still in flight is answered with 409 - as is a key whose original request was interrupted before it finished, for a few minutes afterwards, until that attempt is presumed dead. A completed response stays replayable for 24 hours. The key is scoped to the caller, not to the action: reusing it for a different action is answered with 409 or 422 rather than treated independently. On read actions this header is ignored. On write actions that cannot offer the guarantee it is answered with 400 IDEMPOTENCY_NOT_SUPPORTED rather than silently ignored. |
Request body
Required, application/json: createCreditCardEntryInput.
| Field | Type | Required | Description |
|---|---|---|---|
entityId |
string | yes | The legal entity the entry is posted under. See id on GET base/entities. Example: "e8dc29b9-7e79-4709-bb32-95938bcb1bd1". |
creditCardAccountId |
string | yes | The general-ledger account behind the credit card account this entry posts against. See id on GET accounting/accounts/:id. Example: "f50164c3-85e3-4dab-986e-3fdb39f8ecc1". |
transactionDate |
date | yes | The date the transaction took place. Use format YYYY-MM-DD. It decides the posting period. Example: "2026-02-14". |
currency |
string | no | The currency of the entry. Format ISO 4217, for example 'USD'. It governs every amount on the entry. Omit to use the account's own currency. When supplied it must match the account's currency. Example: "USD". |
status |
string | no | The reconciliation status. Accepted values: 'Matched', 'Unmatched', 'Posted', 'Voided', 'Integrated'. Defaults to 'Unmatched'. Example: "unmatched". |
name |
string | no | A short name for the entry. Example: "February bank fees". |
description |
string | no | A free-form description of the entry. |
serviceDate |
date | no | The date the goods or services were delivered. Use format YYYY-MM-DD. |
origin |
string | no | The system or process the entry originated from. |
externalUrl |
string | no | A link to the entry in the originating system. |
lines |
array<object> | yes | The lines of the entry, in the order they appear. At least one is required. No line may be zero, and the lines may not sum to zero. Example: [{"accountId":"9994c3ed-f812-44c1-9454-7f36b2bfb0fb","amount":"-125.00","description":"Account maintenance fee","lineType":"oneTime"}]. |
lines[].accountId |
string | yes | The general-ledger account this line posts to. It must not be a grouping account. See id on GET accounting/accounts/:id. |
lines[].amount |
decimal | yes | The line amount, as a decimal in the entry currency. It must be non-zero. |
lines[].description |
string | no | A free-form description of the line. |
lines[].departmentId |
string | no | The department this line is attributed to. See id on GET people/departments/:id. |
lines[].businessUnitId |
string | no | The business unit this line is attributed to. There is no endpoint for it. |
lines[].businessPartnerId |
string | no | The business partner this line is attributed to. Required when vatPercentage or taxCodeId is supplied. There is no endpoint for it. |
lines[].crossChargeEntityId |
string | no | The legal entity this line is cross charged to (Charge to). See id on GET base/entities. The line's cost moves to that entity through an intercompany cross charge journal entry. It must differ from entityId, cross charging must be set up for both entities, and the line must not be prepaid, or the request fails with CROSS_CHARGE_INVALID. |
lines[].lineType |
string | no | The kind of line. Accepted values: 'oneTime', 'prepaid'. Derived from the account's sub-type when omitted. |
lines[].vatPercentage |
decimal | no | The VAT rate applied, as a decimal fraction. For example, 0.19 is 19%. Supplying it requires businessPartnerId. It must match exactly one active tax code of the entity's tax configuration, or the request fails with TAX_CODE_NOT_FOUND or TAX_CODE_AMBIGUOUS. Send taxCodeId when several tax codes share the rate. |
lines[].taxCodeId |
string | no | The tax code this line is taxed under. See lines[].id on GET accounting/tax-configurations/:id. It fills the VAT rate, VAT account and reverse-charge account the line does not state. Supplying it requires businessPartnerId. |
lines[].vatAccountId |
string | no | The general-ledger account the VAT posts to. See id on GET accounting/accounts/:id. |
lines[].reverseVatAccountId |
string | no | The general-ledger account the reverse-charge VAT posts to. See id on GET accounting/accounts/:id. |
lines[].vatAmount |
decimal | no | The VAT amount, as a decimal in the entry currency. Omit to derive it from vatPercentage. |
lines[].netAmount |
decimal | no | The net amount, as a decimal in the entry currency. Omit to derive it from amount less VAT. |
lines[].reportingTags |
array<object> | no | The reporting tags for this line, at most one per reporting dimension. Each tag pairs a dimensionCode with a modelId, and the referenced record must exist. A department or businessUnit tag must agree with departmentId or businessUnitId when both are sent. Omit or send an empty array for a line tagged only by departmentId and businessUnitId. |
lines[].reportingTags[].dimensionCode |
string | yes | The reporting dimension this tag is for. It determines which model modelId points to. Accepted values: 'department', 'businessUnit', 'team', 'location', 'region', 'psaProject', 'employee', 'vendor', 'customer', 'product', 'valueCenter', 'custom'. |
lines[].reportingTags[].modelId |
string | yes | The uuid of the dimension record this tag points to, on the model that dimensionCode names. For example, a region record when dimensionCode is 'region'. |
lines[].amortizationSchedules |
array<object> | no | The amortization schedules to defer this line over, one per accounting book. Only a prepaid line may carry them: on any other line they are refused with AMORTIZATION_NOT_ALLOWED_ON_LINE. Because lineType is derived from the account's sub-type when omitted, a line that resolves to a non-prepaid account is refused the same way. |
lines[].amortizationSchedules[].bookId |
string | no | The accounting book this schedule posts into. See id on GET accounting/books/:id. Omit it on a single-book entity to use that entity's default transaction book; send one entry per book otherwise. Two entries for the same book are refused with DUPLICATE_AMORTIZATION_BOOK. |
lines[].amortizationSchedules[].deferredAccountId |
string | no | The general ledger account the deferred balance sits on until it is recognized. See id on GET accounting/accounts/:id. Defaults to the line's own accountId. |
lines[].amortizationSchedules[].recognitionAccountId |
string | yes | The general ledger account where each schedule line recognizes the expense. See id on GET accounting/accounts/:id. |
lines[].amortizationSchedules[].amortizationMethod |
string | yes | How the schedule spreads its total. Values include 'exactDays', 'pointInTime', 'straightLine', 'straightLineProRateFirstLast' and 'usageBased'. |
lines[].amortizationSchedules[].amortizationStartDate |
date | yes | The first day the schedule amortizes over. Format YYYY-MM-DD. It must not be after amortizationEndDate. |
lines[].amortizationSchedules[].amortizationEndDate |
date | yes | The last day the schedule amortizes over, inclusive. Format YYYY-MM-DD. |
lines[].amortizationSchedules[].term |
decimal | yes | The number of months the schedule spreads over. Required, because the schedule lines are created from it when the entry's journal entry is posted. |
lines[].amortizationSchedules[].description |
string | no | A note to record against the schedule. |
attachments |
array<object> | no | Files to attach to the entry, each an uploaded file sent as file (see file below). Required on a tenant configured to require an attachment. |
attachments[].fileName |
string | no | The display name of the attached file. Defaults to the uploaded file's name. Required with fileId. |
attachments[].fileId |
string | no | Deprecated: an already-stored file's identifier. Use file instead. Send exactly one of file or fileId. |
attachments[].file |
file | no | The file, as the upload reference returned by POST /public/files/{namespace}/createCreditCardEntry (multipart/form-data, Api-Version header). {namespace} is the segment after /public/api/ in your base URL. Upload right before this call: a reference works only for createCreditCardEntry, only for you, and for a few minutes. Up to 15 MB each; accepted types: pdf, tiff, jpeg, jpg, png, xls, xlsx, csv, xml, doc, docx, heic, heif. |
{
"entityId": "e8dc29b9-7e79-4709-bb32-95938bcb1bd1",
"creditCardAccountId": "f50164c3-85e3-4dab-986e-3fdb39f8ecc1",
"transactionDate": "2026-02-14",
"lines": [
{
"accountId": "9994c3ed-f812-44c1-9454-7f36b2bfb0fb",
"amount": "-125.00",
"description": "Account maintenance fee",
"lineType": "oneTime"
}
]
}
Response
200 Success
Under data (createCreditCardEntryOutput):
| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes | The unique identifier for the created credit card entry. Example: "c41d0b58-2e97-4f6a-8d13-7b5e9c204af6". |
{
"data": {
"id": "c41d0b58-2e97-4f6a-8d13-7b5e9c204af6"
},
"diagnostics": [
{
"code": "<code>",
"message": "<message>",
"severity": "error",
"path": [
"<path>"
],
"details": "<details>"
}
]
}
Files
attachments[].filetakes an upload reference: upload the file first asmultipart/form-datatoPOST /public/files/{namespace}/createCreditCardEntry(withApi-Version), and send thedata.<part name>value it returns.
Response headers
Idempotency-Replayed— Present andtrueonly when this response replays a previously stored one for the same Idempotency-Key, rather than reflecting a live execution. Absent on a live response - never sent asfalse.
Errors
| Code | Status |
|---|---|
INVALID_ATTACHMENT |
400 |
UNSUPPORTED_FILE_TYPE |
400 |
REFERENCE_NOT_FOUND |
400 |
INVALID_FIELD_VALUE |
400 |
REPORTING_TAG_CONFLICT |
400 |
TAG_VALIDATION_FAILED |
400 |
TAGS_DISABLED |
400 |
POSTING_PERIOD_NOT_OPEN |
400 |
CURRENCY_MISMATCH |
400 |
ACCOUNT_ENTITY_MISMATCH |
400 |
GROUPING_ACCOUNT_NOT_ALLOWED |
400 |
BUSINESS_PARTNER_REQUIRED_FOR_VAT |
400 |
TAX_CODE_NOT_FOUND |
400 |
TAX_CODE_AMBIGUOUS |
400 |
TAX_CODE_ACCOUNT_NOT_CONFIGURED |
400 |
NO_LINES |
400 |
ZERO_LINE_AMOUNT |
400 |
ZERO_TOTAL_AMOUNT |
400 |
ATTACHMENT_REQUIRED |
400 |
CROSS_CHARGE_INVALID |
400 |
AMORTIZATION_NOT_ALLOWED_ON_LINE |
400 |
AMORTIZATION_DATE_RANGE_INVALID |
400 |
AMORTIZATION_BOOK_NOT_CONFIGURED |
400 |
DUPLICATE_AMORTIZATION_BOOK |
400 |
AMORTIZATION_TERM_MISMATCH |
400 |
AMORTIZATION_METHOD_INVALID |
400 |
AMORTIZATION_SCHEDULE_NOT_FOUND |
400 |
AMORTIZATION_SCHEDULE_POSTED |
400 |
IDEMPOTENCY_KEY_CONFLICT |
409 |
IDEMPOTENCY_PAYLOAD_MISMATCH |
422 |
Statuses
400— Invalid request or business failure. Codes: INVALID_ATTACHMENT, UNSUPPORTED_FILE_TYPE, REFERENCE_NOT_FOUND, INVALID_FIELD_VALUE, REPORTING_TAG_CONFLICT, TAG_VALIDATION_FAILED, TAGS_DISABLED, POSTING_PERIOD_NOT_OPEN, CURRENCY_MISMATCH, ACCOUNT_ENTITY_MISMATCH, GROUPING_ACCOUNT_NOT_ALLOWED, BUSINESS_PARTNER_REQUIRED_FOR_VAT, TAX_CODE_NOT_FOUND, TAX_CODE_AMBIGUOUS, TAX_CODE_ACCOUNT_NOT_CONFIGURED, NO_LINES, ZERO_LINE_AMOUNT, ZERO_TOTAL_AMOUNT, ATTACHMENT_REQUIRED, CROSS_CHARGE_INVALID, AMORTIZATION_NOT_ALLOWED_ON_LINE, AMORTIZATION_DATE_RANGE_INVALID, AMORTIZATION_BOOK_NOT_CONFIGURED, DUPLICATE_AMORTIZATION_BOOK, AMORTIZATION_TERM_MISMATCH, AMORTIZATION_METHOD_INVALID, AMORTIZATION_SCHEDULE_NOT_FOUND, AMORTIZATION_SCHEDULE_POSTED401— The request carries no valid access token.403— Not authorized404— Not found409— The Idempotency-Key is still being processed by another request.422— The Idempotency-Key was already used with a different request payload.429— Too many requests from this client address. The response has no body and noRetry-Afterheader.500— Internal server error