---
title: Create a new Credit Note
slug: create-a-new-credit-note
docTags: 
createdAt: 2026-07-08T10:17:45.197Z
---

{
  "id": "-2j1yuTdunH_7P6NjpCh-",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://developer.digitail.io/api/v1/credit-notes",
    "servers": [
      {
        "url": "https://developer.digitail.io/api/v1/credit-notes",
        "description": "Sandbox server (uses test data)"
      },
      {
        "url": "https://vet.digitail.io/api/v1/credit-notes",
        "description": "Production server (uses live data)"
      }
    ],
    "name": "Create a new Credit Note",
    "description": "Create a Credit Note",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "creditnote",
          "description": "",
          "schema": [
            {
              "name": "clinic_id",
              "kind": "required",
              "type": "integer",
              "description": "",
              "example": 1
            },
            {
              "name": "sale_id",
              "kind": "optional",
              "type": "integer",
              "description": "",
              "example": 1
            },
            {
              "name": "customer_id",
              "kind": "required",
              "type": "integer",
              "description": "",
              "example": 1
            },
            {
              "name": "amount",
              "kind": "required",
              "type": "number<float>",
              "description": "",
              "example": 100,
              "format": "float"
            },
            {
              "name": "reason",
              "kind": "required",
              "type": "string",
              "description": "",
              "example": "Reason for CreditNote"
            },
            {
              "name": "date",
              "kind": "required",
              "type": "string<date-time>",
              "description": "Creation date and time in UTC as Zulu ISO8601",
              "example": "2021-01-30T08:30:00Z",
              "format": "date-time"
            },
            {
              "name": "description",
              "kind": "optional",
              "type": "string",
              "description": "Credit note description",
              "example": "Short description"
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "passport",
          "name": "passport",
          "kind": "optional",
          "type": "oauth2",
          "description": "Laravel passport oauth2 security.",
          "oauth2Flows": {
            "authorizationCode": {
              "authorizationUrl": "https://digitail.test/oauth/authorize",
              "tokenUrl": "https://digitail.test/oauth/token",
              "refreshUrl": "https://digitail.test/oauth/token"
            }
          }
        },
        {
          "id": "Bearer",
          "name": "Bearer",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "201",
        "description": "Successful operation",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "data",
                "kind": "optional",
                "type": "object",
                "description": "",
                "example": "",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "clinic_id",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "vet_id",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "sale_id",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "customer_id",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 1
                  },
                  {
                    "name": "status",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "opened"
                  },
                  {
                    "name": "type",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "product_return"
                  },
                  {
                    "name": "series",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "DGT"
                  },
                  {
                    "name": "number",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "1"
                  },
                  {
                    "name": "tax_amount",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "250.00"
                  },
                  {
                    "name": "subtotal",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "250.00"
                  },
                  {
                    "name": "total",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "250.00"
                  },
                  {
                    "name": "description",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "Short description"
                  },
                  {
                    "name": "made_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "",
                    "example": "2021-01-30T08:30:00Z",
                    "format": "date-time"
                  },
                  {
                    "name": "voided_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "",
                    "example": "2021-01-30T08:30:00Z",
                    "format": "date-time"
                  },
                  {
                    "name": "created_at",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "2022-07-18T08:58:36.000000Z"
                  },
                  {
                    "name": "updated_at",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "2022-07-18T08:58:36.000000Z"
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "-nZUpQUh1JNmcbwvakWYm",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://developer.digitail.io/api/v1/credit-notes \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"clinic_id\": 1,\n     \"customer_id\": 1,\n     \"amount\": 100,\n     \"reason\": \"Reason for CreditNote\",\n     \"date\": \"2021-01-30T08:30:00Z\"\n     }'"
        },
        {
          "id": "o4XjWKE3yBhpfetI_Gduj",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"clinic_id\": 1,\n   \"customer_id\": 1,\n   \"amount\": 100,\n   \"reason\": \"Reason for CreditNote\",\n   \"date\": \"2021-01-30T08:30:00Z\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://developer.digitail.io/api/v1/credit-notes\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "00wgb3KTgCJrZXGLDdvgq",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://developer.digitail.io/api/v1/credit-notes\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"clinic_id\": 1,\n   \"customer_id\": 1,\n   \"amount\": 100,\n   \"reason\": \"Reason for CreditNote\",\n   \"date\": \"2021-01-30T08:30:00Z\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "FToJrlxUFUkg-M3T008b1",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://developer.digitail.io/api/v1/credit-notes\"\n\npayload = json.dumps({\n   \"clinic_id\": 1,\n   \"customer_id\": 1,\n   \"amount\": 100,\n   \"reason\": \"Reason for CreditNote\",\n   \"date\": \"2021-01-30T08:30:00Z\"\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "-nZUpQUh1JNmcbwvakWYm"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-201",
          "language": "201",
          "code": "// Successful operation\n{\n  \"data\": {\n    \"id\": 1,\n    \"clinic_id\": 1,\n    \"vet_id\": 1,\n    \"sale_id\": 1,\n    \"customer_id\": 1,\n    \"status\": \"opened\",\n    \"type\": \"product_return\",\n    \"series\": \"DGT\",\n    \"number\": \"1\",\n    \"tax_amount\": \"250.00\",\n    \"subtotal\": \"250.00\",\n    \"total\": \"250.00\",\n    \"description\": \"Short description\",\n    \"made_at\": \"2021-01-30T08:30:00Z\",\n    \"voided_at\": \"2021-01-30T08:30:00Z\",\n    \"created_at\": \"2022-07-18T08:58:36.000000Z\",\n    \"updated_at\": \"2022-07-18T08:58:36.000000Z\"\n  }\n}"
        }
      ],
      "selectedLanguageId": "response-0-201"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}