Acreum Docs
General ledger

Vendor Credits

POST
/v1/vendor-credits/{id}/apply

Required scope: documents:write

Plannable: yes. An agent can use this operation as a step in a plan.

Error codes: DOCUMENT_NOT_FOUND, VALIDATION_FAILED, CREDIT_NOT_FULLY_APPLIED, CREDIT_HAS_ACTIVE_APPLICATIONS, LEGAL_ENTITY_MISMATCH, PARTY_MISMATCH, CURRENCY_MISMATCH, DOCUMENT_STATUS_FORBIDS_ACTION, LEGAL_ENTITY_NOT_IN_SCOPE, IDEMPOTENCY_KEY_REQUIRED, INVALID_IDEMPOTENCY_KEY, IDEMPOTENCY_CONFLICT

Authorization

access-token
headerAuthorizationBearer <token>

Path Parameters

id*string

Header Parameters

Idempotency-Key*string

Client-chosen key that makes this mutation safe to retry. Required — a request without one is rejected with IDEMPOTENCY_KEY_REQUIRED. Reusing a key with the same body replays the original response for ~24 hours; reusing it with a different body returns IDEMPOTENCY_CONFLICT.

Match^[A-Za-z0-9_-]{1,255}$
Lengthlength <= 255

Request Body

application/json
  1. body
applications*array<>

One row per target. Sum of amounts must equal the credit's remaining balance.

Response Body

application/json
  1. response
data*
meta*
curl -X POST 'https://api.acreum.io/v1/vendor-credits/string/apply' \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "applications": [    {      "amount": "100.00",      "document_id": "b792e8ae-2cb4-4209-85b9-32be4c2fcdd6"    }  ]}'
{  "data": {    "applications": [      {        "applied_amount": "100.00",        "applied_at": "2019-08-24T14:15:22Z",        "applied_document_id": "149f34b8-0f1d-4789-a113-13a4b4315226",        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "payment_document_id": "c0e84883-37cf-4eff-ab7a-c5ce998065ab",        "unapplied_at": "2019-08-24T14:15:22Z"      }    ],    "balance_amount": "0.00",    "document_type": "credit_memo",    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "status": "posted"  },  "meta": {    "api_version": "2026-04-23",    "cursor": {      "has_more": true,      "next": "eyJpZCI6ICJhYmMifQ=="    },    "request_id": "018f0b3d-2b1e-7c8a-9d4b-1a2b3c4d5e6f",    "total_count": 1234  }}
POST
/v1/vendor-credits/{id}/reverse-apply

Required scope: documents:write

Error codes: DOCUMENT_NOT_FOUND, VALIDATION_FAILED, DOCUMENT_STATUS_FORBIDS_ACTION, DOCUMENT_RECONCILED_CANNOT_CHANGE, DOCUMENT_REFUNDS_EXCEED_REMAINING_PAYMENTS, LEGAL_ENTITY_NOT_IN_SCOPE, IDEMPOTENCY_KEY_REQUIRED, INVALID_IDEMPOTENCY_KEY, IDEMPOTENCY_CONFLICT

Authorization

access-token
headerAuthorizationBearer <token>

Path Parameters

id*string

Header Parameters

Idempotency-Key*string

Client-chosen key that makes this mutation safe to retry. Required — a request without one is rejected with IDEMPOTENCY_KEY_REQUIRED. Reusing a key with the same body replays the original response for ~24 hours; reusing it with a different body returns IDEMPOTENCY_CONFLICT.

Match^[A-Za-z0-9_-]{1,255}$
Lengthlength <= 255

Response Body

application/json
  1. response
data*
meta*
curl -X POST 'https://api.acreum.io/v1/vendor-credits/string/reverse-apply' \  -H 'Idempotency-Key: string'
{  "data": {    "applications": [      {        "applied_amount": "100.00",        "applied_at": "2019-08-24T14:15:22Z",        "applied_document_id": "149f34b8-0f1d-4789-a113-13a4b4315226",        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "payment_document_id": "c0e84883-37cf-4eff-ab7a-c5ce998065ab",        "unapplied_at": "2019-08-24T14:15:22Z"      }    ],    "balance_amount": "0.00",    "document_type": "credit_memo",    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "status": "posted"  },  "meta": {    "api_version": "2026-04-23",    "cursor": {      "has_more": true,      "next": "eyJpZCI6ICJhYmMifQ=="    },    "request_id": "018f0b3d-2b1e-7c8a-9d4b-1a2b3c4d5e6f",    "total_count": 1234  }}