Creates a vendor credit.
POST /accounting/vendor-credits
Group: Accounting › Vendor Credits · Operation ID: createVendorCredit
The response contains only the new credit's id. Read the record with GET accounting/vendor-credits/:id if you need its stored state, where vendorCreditNumber appears once assigned. A new credit is always unapplied: the application status is computed from the bills it is applied to and cannot be supplied here. currency governs every line amount and vatAmount, which are decimals with no currency of their own. Applying the credit to a vendor bill is a separate operation, POST accounting/vendor-credits/:id/apply.
Open in the interactive reference
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Api-Version |
header | "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: createVendorCreditInput.
| Field | Type | Required | Description |
|---|---|---|---|
vendorId |
string | yes | The vendor being credited. See id on GET accounting/vendors/:id. |
entityId |
string | yes | The legal entity the credit is booked under. See id on GET base/entities. |
referenceNumber |
string | yes | The vendor's credit memo reference number, as printed on the document. |
creditDate |
string (date) | yes | The date on the vendor's credit memo. Use format YYYY-MM-DD. |
currency |
string | yes | The currency of the credit. Format ISO 4217, for example 'USD'. Governs every line amount and vatAmount, which are decimals. |
origin |
string | no | The source system this record came from, as free-form text, for example 'Ramp'. Omit it and it stays unset. The server does not set a value. |
lines |
array of object | yes | The line items of the credit, in the order they should appear. At least one is expected. A credit with no lines credits nothing. |
lines[].amount |
string (decimal) | yes | The gross credit amount for the line, as a decimal in the credit currency. |
lines[].description |
string | no | A description of the credit line. |
lines[].accountId |
string | no | The GL account this line credits. See id on GET accounting/accounts/:id. |
lines[].departmentId |
string | no | The department this line is allocated to. See id on GET departments/:id. |
lines[].businessUnitId |
string | no | The business unit this line is allocated to. There is no endpoint for it. |
lines[].vatPercentage |
string (decimal) | no | The VAT rate applied, as a percentage. 19 means 19%, not 0.19. |
lines[].vatAccountId |
string | no | The GL account the VAT posts to. See id on GET accounting/accounts/:id. |
lines[].reverseVatAccountId |
string | no | The GL account reverse-charge VAT posts to. See id on GET accounting/accounts/:id. |
lines[].vatAmount |
string (decimal) | no | The explicit VAT amount, as a decimal in the credit currency. Omit to derive it from vatPercentage. |
lines[].valueAllocationId |
string | no | The value-allocation rule distributing this line across dimensions. There is no endpoint for it. |
lines[].lineType |
string | no | The kind of line. Accepted values: 'expense' (a one-time credit) or 'prepaid' (a credit spread over several periods). Defaults to 'expense'. |
attachments |
array of object | no | Files to attach to the credit. Each names an already-uploaded file by its id. |
attachments[].fileName |
string | yes | The display name of the attached file. |
attachments[].fileId |
string | yes | The identifier of the already-uploaded file. There is no endpoint for it. |
Example:
{
"vendorId": "3b7d5e9c-1a24-4f80-9c6d-2e8f70b13a45",
"entityId": "8f2c1d40-5a6b-4c7d-9e80-1f2a3b4c5d6e",
"referenceNumber": "CN-4471",
"creditDate": "2026-08-01",
"currency": "EUR",
"origin": "<origin>",
"lines": [
{
"amount": "300.00",
"description": "Returned goods",
"vatPercentage": "19.00"
}
],
"attachments": [
{
"fileName": "<fileName>",
"fileId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
]
}
Response
200 Success
Under data (createVendorCreditOutput):
| Field | Type | Required | Description |
|---|---|---|---|
id |
string | yes | The unique identifier for the created vendor credit. |
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 |
|---|---|
REFERENCE_NOT_FOUND |
400 |
TOO_MANY_LINES |
400 |
IDEMPOTENCY_KEY_CONFLICT |
409 |
IDEMPOTENCY_PAYLOAD_MISMATCH |
422 |
Statuses
400— Invalid request or business failure. Codes: REFERENCE_NOT_FOUND, TOO_MANY_LINES401— Missing or invalid access token403— 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 requests500— Internal server error