---
title: Delete payment account
slug: docs/demo/delete-payment-account
description: Learn how to use the curl command to send a DELETE request to a specific endpoint on our fictive API. This code example demonstrates how to include the account reference and payment detail ID in the URL, as well as how to specify the accepted response for
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "-S_vedUhiH6QPUQSM8cH2",
  "data": {
    "url": "https://api.fictive.com/REST/api/accounts/{accountReference}/payment-details/{paymentDetailId}",
    "name": "Delete payment account",
    "method": "DELETE",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "accountReference",
          "type": "string"
        },
        {
          "kind": "required",
          "name": "paymentDetailId",
          "type": "integer"
        }
      ],
      "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": [],
      "formDataParameters": []
    },
    "responses": [
      {
        "isExpanded": true,
        "statusCode": "204",
        "description": "No Content",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "400",
        "description": "Unable to authenticate using the provided session",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "401",
        "description": "Not Authorized",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "404",
        "description": "Account Does Not Exist.\r\n            <br />• AccountId doesn't match with the PaymentDetailId.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "Internal Server Error",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint will provide the ability to delete a saved payment account from the eSuite platform",
    "examples": {
      "languages": [
        {
          "id": "zLYkt_uJu6XC1eEkOHAXv",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url https://api.fictive.com/REST/api/accounts/{accountReference}/payment-details/{paymentDetailId} \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "gRBjXdltSseHj_1Qt4L1A",
          "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 requestOptions = {\n   method: 'DELETE',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.fictive.com/REST/api/accounts/{accountReference}/payment-details/{paymentDetailId}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "zb_bblWjvC8W88obwRtZF",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/accounts/{accountReference}/payment-details/{paymentDetailId}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Delete.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-version\"] = \"string\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "OKcnqD3Pz72JUx0ku4LDP",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/accounts/{accountReference}/payment-details/{paymentDetailId}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-version': 'string'\n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "zLYkt_uJu6XC1eEkOHAXv"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-204",
          "language": "204",
          "code": "// No Content\n"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Unable to authenticate using the provided session\n"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Not Authorized\n"
        },
        {
          "id": "response-3-404",
          "language": "404",
          "code": "// Account Does Not Exist.\r\n            • AccountId doesn't match with the PaymentDetailId.\n"
        },
        {
          "id": "response-4-500",
          "language": "500",
          "code": "// Internal Server Error\n"
        }
      ],
      "selectedLanguageId": "response-0-204"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}