---
title: Update a payment instruction
slug: docs/demo/GHlr-update-a-payment-instruction
description: Learn how to send a PATCH request using the curl command with this detailed code example. Find the essential headers and JSON payload data included, making it easier to interact with a specific endpoint. Perfect for developers seeking a seamless method fo
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "DSl8PH6mTWf7WYggFsPxo",
  "data": {
    "url": "https://api.fictive.com/REST/api/accounts/{accountReference}/payments/{paymentReference}",
    "name": "Update a payment instruction",
    "method": "PATCH",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "accountReference",
          "type": "string",
          "description": "Account reference"
        },
        {
          "kind": "required",
          "name": "paymentReference",
          "type": "string",
          "description": "The payment reference"
        }
      ],
      "queryParameters": [],
      "headerParameters": [
        {
          "kind": "optional",
          "name": "X-TokenId",
          "type": "string",
          "description": "The eSuite Token Id"
        },
        {
          "kind": "optional",
          "name": "X-SessionId",
          "type": "string",
          "description": "The eSuite Session Id"
        },
        {
          "kind": "required",
          "name": "X-Version",
          "type": "string",
          "description": "The eSuite Version"
        },
        {
          "kind": "optional",
          "name": "Origin",
          "type": "string",
          "description": "The eSuite Origin"
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "patchRequest",
          "type": "array",
          "schema": [
            {
              "kind": "optional",
              "name": "value",
              "type": "object",
              "schema": [],
              "modelRef": "#/definitions/System.Object",
              "customType": "System.Object"
            },
            {
              "kind": "optional",
              "name": "path",
              "type": "string",
              "example": ""
            },
            {
              "kind": "optional",
              "name": "op",
              "type": "string",
              "example": ""
            },
            {
              "kind": "optional",
              "name": "from",
              "type": "string",
              "example": ""
            }
          ],
          "modelRef": "#/definitions/Microsoft.AspNet.JsonPatch.JsonPatchDocument[FictiveGlobal.Api.Rest.Dtos.v1.Patch.Orders.OrderPatchModel]",
          "customType": "Microsoft.AspNet.JsonPatch.JsonPatchDocument[FictiveGlobal.Api.Rest.Dtos.v1.Patch.Orders.OrderPatchModel]",
          "isExpanded": true
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "isExpanded": true,
        "statusCode": "204",
        "description": "No Content",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "400",
        "description": "Bad Request\r\n            <br />• {parameter name} is not configured as a custom parameter\r\n            <br />• Cannot provide the same parameter name multiple times\r\n            <br />• Unable to amend {parameter name} as it does not exist",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "401",
        "description": "Unauthorized\r\n            <br />• API Authentication Failure: Invalid Authentication Type/Credentials Provided",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "404",
        "description": "Not Found\r\n            <br />• Account cannot be found\r\n            <br />• Payment cannot be found",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "405",
        "description": "Method Not Allowed\r\n            <br />• {actionType} is not a supported action on this resource",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint will provide the ability to update a payment instruction for a given account",
    "examples": {
      "languages": [
        {
          "id": "g25TNMHyw_7nRzkuNj4aX",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PATCH \\\n     --url https://api.fictive.com/REST/api/accounts/{accountReference}/payments/{paymentReference} \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --header 'x-version: string' \\\n     --data '[\n     {}\n     ]'"
        },
        {
          "id": "siWxmf8fDi7hsgszOtHSF",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-version\", \"string\");\n\nvar raw = JSON.stringify([\n   {}\n]);\n\nvar requestOptions = {\n   method: 'PATCH',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.fictive.com/REST/api/accounts/{accountReference}/payments/{paymentReference}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "sDMtyFwG--ltpHh1kW4x4",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/accounts/{accountReference}/payments/{paymentReference}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Patch.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-version\"] = \"string\"\nrequest.body = JSON.dump([\n   {}\n])\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "ctB4I-IW1xmjCGJE0xjZZ",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/accounts/{accountReference}/payments/{paymentReference}\"\n\npayload = json.dumps([\n   {}\n])\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-version': 'string'\n}\n\nresponse = requests.request(\"PATCH\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "g25TNMHyw_7nRzkuNj4aX"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-204",
          "language": "204",
          "code": "// No Content\n"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Bad Request\r\n            • {parameter name} is not configured as a custom parameter\r\n            • Cannot provide the same parameter name multiple times\r\n            • Unable to amend {parameter name} as it does not exist\n"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Unauthorized\r\n            • API Authentication Failure: Invalid Authentication Type/Credentials Provided\n"
        },
        {
          "id": "response-3-404",
          "language": "404",
          "code": "// Not Found\r\n            • Account cannot be found\r\n            • Payment cannot be found\n"
        },
        {
          "id": "response-4-405",
          "language": "405",
          "code": "// Method Not Allowed\r\n            • {actionType} is not a supported action on this resource\n"
        }
      ],
      "selectedLanguageId": "response-0-204"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}