Skip to content

applyCreditsToInvoices

DESTRUCTIVE

Apply credits to invoices.

POST /api/v1/invoicing/applyCreditsToInvoices
curl -X POST '<your-host>/api/v1/invoicing/applyCreditsToInvoices' \
  -H 'Authorization: Bearer <api-key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "paymentId": "string",
    "appliedDate": "string",
    "side": "sales",
    "applications": []
  }'

Parameters

ParameterType
"sales""purchase"

Input schema

schema
{
  "type": "object",
  "properties": {
    "paymentId": {
      "type": "string"
    },
    "appliedDate": {
      "type": "string"
    },
    "side": {
      "type": "string",
      "enum": [
        "sales",
        "purchase"
      ]
    },
    "applications": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "memoId": {
            "type": "string"
          },
          "invoiceId": {
            "type": "string"
          },
          "amount": {
            "type": "number"
          },
          "sourceAmount": {
            "type": "number"
          }
        },
        "required": [
          "memoId",
          "invoiceId",
          "amount"
        ]
      }
    }
  },
  "required": [
    "paymentId",
    "appliedDate",
    "side",
    "applications"
  ]
}