---
title: Pay Sale with client credit
slug: pay-sale-with-client-credit
docTags: 
createdAt: 2026-04-21T15:22:49.957Z
---

{
  "id": "bantIVBasyCYTNPE-0LAO",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://developer.digitail.io/api/v1/sales/{id}/pay-with-credit",
    "servers": [
      {
        "url": "https://developer.digitail.io/api/v1/sales/{id}/pay-with-credit",
        "description": "Sandbox server (uses test data)"
      },
      {
        "url": "https://vet.digitail.io/api/v1/sales/{id}/pay-with-credit",
        "description": "Production server (uses live data)"
      }
    ],
    "name": "Pay Sale with client credit",
    "description": "<p>Permissions needed: any of (CREATE_CHECKUPS, VIEW_COUNTER_SALE)\nIf amount sent is greater than sale amount due, after the sale is paid, difference between amount sent and sale amount due is used to pay outstanding balance sales.</p>",
    "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": "object",
          "description": "",
          "schema": [
            {
              "name": "amount",
              "kind": "optional",
              "type": "number<double>",
              "description": "",
              "example": "100,00",
              "format": "double"
            },
            {
              "name": "type",
              "kind": "optional",
              "type": "integer",
              "description": "Payment from client credit has type 8",
              "default": 8
            },
            {
              "name": "date",
              "kind": "optional",
              "type": "string<date-time>",
              "description": "Payment date.",
              "format": "date-time"
            },
            {
              "name": "notes",
              "kind": "optional",
              "type": "string",
              "description": "<p>Payment notes - if not sent then the notes from the charge will be used</p>",
              "example": "Paid with credit"
            }
          ],
          "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": "200",
        "description": "<p>Successful operation - return sale's payments</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "data",
                "kind": "optional",
                "type": "object",
                "description": "A payment is the act of allocating a charge to a sale. A payment can be made in full or partially.",
                "example": "",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 6
                  },
                  {
                    "name": "amount",
                    "kind": "optional",
                    "type": "number<double>",
                    "description": "",
                    "example": "100.00",
                    "format": "double"
                  },
                  {
                    "name": "amount_refunded",
                    "kind": "optional",
                    "type": "number<double>",
                    "description": "",
                    "example": "0.00",
                    "format": "double"
                  },
                  {
                    "name": "amount_left",
                    "kind": "optional",
                    "type": "number<double>",
                    "description": "",
                    "example": "0.00",
                    "format": "double"
                  },
                  {
                    "name": "made_at",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "description": "",
                    "example": "2023-12-14T11:32:44.000000Z",
                    "format": "date-time"
                  },
                  {
                    "name": "notes",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": ""
                  },
                  {
                    "name": "type",
                    "kind": "optional",
                    "type": "integer",
                    "description": "<p>Payment method the allocated charge was made with. <code>1</code> - Cash <code>2</code> - Card <code>3</code> - Order <code>4</code> - Overdraft <code>5</code> - Online <code>6</code> - Check <code>7</code> - Other <code>8</code> - Client Credit <code>9</code> - Care Credit <code>10</code> - Pet Transfer Acquitted <code>11</code> - Credit Note</p>",
                    "example": 2,
                    "enum": [
                      "1",
                      "2",
                      "3",
                      "4",
                      "5",
                      "6",
                      "7",
                      "8",
                      "9",
                      "10",
                      "11"
                    ]
                  },
                  {
                    "name": "sale_id",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 5
                  },
                  {
                    "name": "sale",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "modelRef": "#/paths/~1api~1v1~1sales/post/responses/200/content/application~1json/schema/properties/data",
                    "customType": "data",
                    "schema": []
                  },
                  {
                    "name": "charge_id",
                    "kind": "optional",
                    "type": "integer",
                    "description": "",
                    "example": 4
                  },
                  {
                    "name": "charge",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "modelRef": "#/paths/~1api~1v1~1charges/post/responses/201/content/application~1json/schema/properties/data",
                    "customType": "data",
                    "schema": []
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "x088FzGw5M8n3mcOXYowM",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://developer.digitail.io/api/v1/sales/{id}/pay-with-credit \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"type\": 8\n     }'"
        },
        {
          "id": "23PO6IE7AKzSAxy-UPTJM",
          "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   \"type\": 8\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/sales/{id}/pay-with-credit\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "naaTfkywpg0HCQoU7Xwb0",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://developer.digitail.io/api/v1/sales/{id}/pay-with-credit\")\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   \"type\": 8\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "cztZlfbfPL17MUnlorJ7K",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://developer.digitail.io/api/v1/sales/{id}/pay-with-credit\"\n\npayload = json.dumps({\n   \"type\": 8\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": "x088FzGw5M8n3mcOXYowM"
    },
    "results": {
      "languages": [
        {
          "id": "-8JoLcwQSMZm0Naw8xb-R",
          "language": "200",
          "code": "// Successful operation - return sale's payments\n{\n  \"data\": {\n    \"id\": 6,\n    \"amount\": \"100.00\",\n    \"amount_refunded\": \"0.00\",\n    \"amount_left\": \"0.00\",\n    \"made_at\": \"2023-12-14T11:32:44.000000Z\",\n    \"notes\": \"\",\n    \"type\": 2,\n    \"sale_id\": 5,\n    \"sale\": {},\n    \"charge_id\": 4,\n    \"charge\": {}\n  }\n}"
        }
      ],
      "selectedLanguageId": "-8JoLcwQSMZm0Naw8xb-R"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}