---
title: Delete customer prepaid order
slug: reference/delete-customer-prepaid-order
docTags: 
createdAt: 2025-03-18T18:28:02.918Z
---

{
  "id": "3CkAYtFAct0GKbAmo-GWU",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "https://app.amberflo.io/payments/pricing/amberflo/customer-prepaid",
    "servers": [
      {
        "url": "https://app.amberflo.io/payments/pricing/amberflo/customer-prepaid"
      }
    ],
    "name": "Delete customer prepaid order",
    "description": "<p>Deletes a specific customer prepaid order and removes any unused credit balance.\nThis operation is typically used to cancel prepaid orders before they are fully consumed.</p>\n<p>Use this endpoint to:</p>\n<ul>\n<li>Cancel unwanted prepaid credit orders</li>\n<li>Remove unused prepaid balances</li>\n<li>Clean up prepaid orders due to billing errors</li>\n<li>Process prepaid refund requests</li>\n</ul>\n<p><strong>Important</strong>: This operation permanently removes the prepaid order and cannot be undone.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "required",
          "name": "customerId",
          "type": "string",
          "example": "customer_123",
          "description": "Unique identifier of the customer whose prepaid order should be deleted.\nRequired unless RelationId is provided.\n"
        },
        {
          "kind": "required",
          "name": "Id",
          "type": "string",
          "example": "prepaid_456",
          "description": "Unique identifier of the specific prepaid order to delete.\nRequired unless RelationId is provided.\n"
        },
        {
          "kind": "optional",
          "name": "RelationId",
          "type": "string",
          "example": "eyJjdXN0b21lcklkIjoiY3VzdG9tZXJfMTIzIiwiaWQiOiJwcmVwYWlkXzQ1NiJ9",
          "description": "<p>Base64-encoded serialized relationship identifier containing customer and prepaid information.\nIf provided, this parameter takes precedence over customerId and Id parameters.</p>"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKey",
          "name": "X-API-KEY",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successfully deleted the prepaid order and returns confirmation message",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "string",
            "description": "",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Invalid customer ID, prepaid ID, or prepaid order does not exist",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "401",
        "description": "Authentication required or invalid API key provided",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "403",
        "description": "Insufficient permissions to delete customer prepaid orders",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "Customer or prepaid order not found",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "409",
        "description": "Cannot delete prepaid order that has been partially or fully consumed",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "500",
        "description": "Internal server error occurred while deleting prepaid order",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "MgxAkVLhMJ782nm2KPT4d",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url 'https://app.amberflo.io/payments/pricing/amberflo/customer-prepaid?customerId=customer_123&Id=prepaid_456' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "Uf6u_Pkk0sMYZzHGgbiRV",
          "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: 'DELETE',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://app.amberflo.io/payments/pricing/amberflo/customer-prepaid?customerId=customer_123&Id=prepaid_456\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "BVQxwXG8Ih9e2EWR1rwIx",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://app.amberflo.io/payments/pricing/amberflo/customer-prepaid?customerId=customer_123&Id=prepaid_456\")\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\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "T6ZPTaVu6O33jd-Wzf8L3",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/payments/pricing/amberflo/customer-prepaid?customerId=customer_123&Id=prepaid_456\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "MgxAkVLhMJ782nm2KPT4d"
    },
    "results": {
      "languages": [
        {
          "id": "32aXH6uHNfh9Qp9wkUfA_",
          "language": "200",
          "code": "// Successfully deleted the prepaid order and returns confirmation message\n\"\""
        },
        {
          "id": "qlQcHgwekChJ_PKDjk3RO",
          "language": "400",
          "code": "// Invalid customer ID, prepaid ID, or prepaid order does not exist\n"
        },
        {
          "id": "81Fae1a1HIQrIdz2Tq4Rl",
          "language": "401",
          "code": "// Authentication required or invalid API key provided\n"
        },
        {
          "id": "AqLMJ8RzWnvgJ7uX35MJi",
          "language": "403",
          "code": "// Insufficient permissions to delete customer prepaid orders\n"
        },
        {
          "id": "bMqdJ-nTyFyqBJKN-0_Zo",
          "language": "404",
          "code": "// Customer or prepaid order not found\n"
        },
        {
          "id": "pd_sBKUpyJEln7fl0kCPv",
          "language": "409",
          "code": "// Cannot delete prepaid order that has been partially or fully consumed\n"
        },
        {
          "id": "MmCKQJ4B6WsvS3kMiqABo",
          "language": "500",
          "code": "// Internal server error occurred while deleting prepaid order\n"
        }
      ],
      "selectedLanguageId": "32aXH6uHNfh9Qp9wkUfA_"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}