---
title: Update a Charge
slug: update-a-charge
docTags: 
createdAt: 2026-04-21T15:22:49.957Z
---

{
  "id": "BB_fG1CygXuu8wx7X2eu5",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://developer.digitail.io/api/v1/sales/{id}/charges",
    "servers": [
      {
        "url": "https://developer.digitail.io/api/v1/sales/{id}/charges",
        "description": "Sandbox server (uses test data)"
      },
      {
        "url": "https://vet.digitail.io/api/v1/sales/{id}/charges",
        "description": "Production server (uses live data)"
      }
    ],
    "name": "Update a Charge",
    "description": "<p>Permissions needed: any of (CREATE_CHECKUPS, VIEW_COUNTER_SALE)\nUpdates charge and returns it.</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": [
        {
          "kind": "optional",
          "name": "include",
          "description": "<p>Additional info to include:  mainSale,mainPayment,payments,chargeReceipt</p>"
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "amount",
              "kind": "optional",
              "type": "number<float>",
              "description": "",
              "example": 100,
              "format": "float"
            },
            {
              "name": "type",
              "kind": "optional",
              "type": "integer",
              "description": "<p><code>1</code> - Cash <code>2</code> - Card <code>3</code> - Order <code>6</code> - Check <code>7</code> - Other</p>",
              "example": 2,
              "enum": [
                "1",
                "2",
                "3",
                "6",
                "7"
              ]
            },
            {
              "name": "card_brand",
              "kind": "optional",
              "type": "object",
              "description": "",
              "modelRef": "#/paths/~1api~1v1~1charges/post/requestBody/content/application~1json/schema/properties/card_brand",
              "customType": "card_brand",
              "schema": []
            },
            {
              "name": "date",
              "kind": "optional",
              "type": "string<date-time>",
              "description": "",
              "example": "2020-01-01T00:00:00Z",
              "format": "date-time"
            },
            {
              "name": "notes",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "",
              "example": ""
            },
            {
              "name": "create_receipt",
              "kind": "optional",
              "type": "boolean",
              "nullable": true,
              "description": "",
              "example": false
            }
          ],
          "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": "Created",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "data",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/paths/~1api~1v1~1charges/post/responses/201/content/application~1json/schema/properties/data",
                "customType": "data",
                "schema": []
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "422",
        "description": "Bad request",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "undefined",
            "example": "{\"message\":\"The given data was invalid.\",\"errors\":{\"card_brand\":[\"The card brand field can only be provided on Payments with Cards\"]}}",
            "description": "",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "0G52JJdzE3wxw-kGQu332",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://developer.digitail.io/api/v1/sales/{id}/charges \\\n     --header 'accept: application/json'"
        },
        {
          "id": "44sBQ4pkfNIg3tX8y8zsM",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://developer.digitail.io/api/v1/sales/{id}/charges\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "wERL6VaLQnqGbGPT1Tl6b",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://developer.digitail.io/api/v1/sales/{id}/charges\")\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\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "q9xUjW2LOEVS48DDeOhq5",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://developer.digitail.io/api/v1/sales/{id}/charges\"\n\npayload = {}\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": "0G52JJdzE3wxw-kGQu332"
    },
    "results": {
      "languages": [
        {
          "id": "VR5LiRFgkxMDGLzsSpY79",
          "language": "201",
          "code": "// Created\n{\n  \"data\": {}\n}"
        },
        {
          "id": "csG5xvM7_3Q2S4WXQ3QoO",
          "language": "422",
          "code": "// Bad request\n\"{\\\"message\\\":\\\"The given data was invalid.\\\",\\\"errors\\\":{\\\"card_brand\\\":[\\\"The card brand field can only be provided on Payments with Cards\\\"]}}\""
        }
      ],
      "selectedLanguageId": "VR5LiRFgkxMDGLzsSpY79"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}