---
title: List customer payment method switches
slug: reference/list-customer-payment-method-switches
docTags: 
createdAt: 2025-08-21T21:09:26.155Z
---

{
  "id": "9QS6gUBc5A_73eJae-LvJ",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://app.amberflo.io/customers/payment-method/switch",
    "servers": [
      {
        "url": "https://app.amberflo.io/customers/payment-method/switch"
      }
    ],
    "name": "List customer payment method switches",
    "description": "<p>Retrieves all payment method switch operations for a specific customer including switch history and status.\nUse this endpoint to track payment method changes and audit payment provider transitions.</p>\n<p>Use this endpoint to:</p>\n<ul>\n<li>View payment method switch history for a customer</li>\n<li>Track successful and failed payment provider transitions</li>\n<li>Audit payment method change operations</li>\n<li>Support customer service inquiries about payment changes</li>\n</ul>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "required",
          "name": "customerId",
          "type": "string",
          "example": "customer_123",
          "description": "Unique identifier of the customer whose payment method switches you want to retrieve"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKey",
          "name": "X-API-KEY",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Returns array of all payment method switch operations for the customer with status and timing details",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "Customer payment method switch configuration defining the scheduled transition from one billing system to another, including audit timestamps and execution status for payment provider migration tracking.",
            "customType": "customer.payment_method.CustomerPaymentMethodSwitch.out[]",
            "schema": [
              {
                "name": "customerId",
                "kind": "required",
                "type": "string",
                "description": "Unique customer identifier for whom the payment method switch configuration applies and payment transitions will be executed.",
                "example": ""
              },
              {
                "name": "sourcePaymentType",
                "kind": "optional",
                "type": "string",
                "description": "Current billing system enumeration indicating the payment provider platform being transitioned away from during the switch operation.",
                "modelRef": "#/components/schemas/customer.payment_method.BillingSystem.in",
                "customType": "customer.payment_method.BillingSystem.in",
                "schema": []
              },
              {
                "name": "sourcePaymentId",
                "kind": "optional",
                "type": "string",
                "description": "Payment provider connection identifier currently active before the switch, referencing existing billing system configuration and account settings.",
                "example": ""
              },
              {
                "name": "targetPaymentType",
                "kind": "required",
                "type": "string",
                "description": "Target billing system enumeration specifying the destination payment provider platform to activate after the scheduled switch execution.",
                "modelRef": "#/components/schemas/customer.payment_method.BillingSystem.in",
                "customType": "customer.payment_method.BillingSystem.in",
                "schema": []
              },
              {
                "name": "targetPaymentId",
                "kind": "required",
                "type": "string",
                "description": "Payment provider connection identifier for the new billing system, referencing target account payment settings and integration configurations.",
                "example": ""
              },
              {
                "name": "targetCustomerIdentifier",
                "kind": "required",
                "type": "string",
                "description": "Customer-specific identifier within the target payment provider system, enabling billing operations and payment processing in the destination platform.",
                "example": ""
              },
              {
                "name": "switchTimeInSeconds",
                "kind": "required",
                "type": "integer<int64>",
                "description": "Unix timestamp in seconds defining the exact moment when payment provider transition activates, evaluated against invoice start times.",
                "example": 0
              },
              {
                "name": "createdTimeInSeconds",
                "kind": "optional",
                "type": "integer<int64>",
                "description": "Unix timestamp in seconds recording when the payment method switch configuration was initially created and stored in the system.",
                "example": 0
              },
              {
                "name": "updatedTimeInSeconds",
                "kind": "optional",
                "type": "integer<int64>",
                "description": "Unix timestamp in seconds tracking the most recent modification to the payment method switch configuration for audit and versioning purposes.",
                "example": 0
              }
            ],
            "modelRef": "#/components/schemas/customer.payment_method.CustomerPaymentMethodSwitch.out",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Invalid customer ID format or missing required parameter",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "401",
        "description": "Authentication required or invalid API key provided",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "403",
        "description": "Insufficient permissions to access customer payment method data",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "Customer not found or no payment method switches recorded",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "500",
        "description": "Internal server error occurred while retrieving payment method switches",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "kmWgfec3Do2AVecDt6heJ",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url 'https://app.amberflo.io/customers/payment-method/switch?customerId=customer_123' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "a5Q2toUtluhdNm3zFemiN",
          "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: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://app.amberflo.io/customers/payment-method/switch?customerId=customer_123\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "9cYbpWOZalVv3oHZIr8kF",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://app.amberflo.io/customers/payment-method/switch?customerId=customer_123\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "8GsdoCZmQUL6rP36XPy1W",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/customers/payment-method/switch?customerId=customer_123\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "kmWgfec3Do2AVecDt6heJ"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Returns array of all payment method switch operations for the customer with status and timing details\n[\n  {\n    \"customerId\": \"\",\n    \"sourcePaymentType\": \"\",\n    \"sourcePaymentId\": \"\",\n    \"targetPaymentType\": \"\",\n    \"targetPaymentId\": \"\",\n    \"targetCustomerIdentifier\": \"\",\n    \"switchTimeInSeconds\": \"\",\n    \"createdTimeInSeconds\": \"\",\n    \"updatedTimeInSeconds\": \"\"\n  }\n]"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Invalid customer ID format or missing required parameter\n"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Authentication required or invalid API key provided\n"
        },
        {
          "id": "response-3-403",
          "language": "403",
          "code": "// Insufficient permissions to access customer payment method data\n"
        },
        {
          "id": "response-4-404",
          "language": "404",
          "code": "// Customer not found or no payment method switches recorded\n"
        },
        {
          "id": "response-5-500",
          "language": "500",
          "code": "// Internal server error occurred while retrieving payment method switches\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}