---
title: Export Order Payments to CSV
slug: api-documentation/export-order-payments-to-csv
docTags: 
createdAt: 2026-08-27T16:57:40.129Z
---

{
  "id": "YPpXgoDsUsTgTR0ybOTrx",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.upstartcommerce.com/v1/order/payments/csv",
    "servers": [
      {
        "url": "https://api.upstartcommerce.com/v1/order/payments/csv"
      }
    ],
    "name": "Export Order Payments to CSV",
    "description": "<p>This endpoint utilizes the UpStart search to allow administrators to export order payments to CSV file.</p>\n<p>Authorized permissions:</p>\n<ul>\n<li><code>order.read</code></li>\n</ul>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "text/csv"
          ],
          "default": "text/csv"
        },
        {
          "kind": "required",
          "name": "x-upstart-tenant",
          "type": "string",
          "description": "Tenant identifier associated with the site this call is for."
        },
        {
          "kind": "required",
          "name": "x-upstart-site",
          "type": "string",
          "description": "Site identifier associated with the site this call is for."
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "customType": "PaymentsCsvRequest",
          "schema": [
            {
              "name": "state",
              "kind": "optional",
              "type": "string",
              "description": "The payment state to filter by in CSV export. Defaults to 'Captured' if not provided. Use 'Authorized' to export uncaptured payments.",
              "example": "Captured",
              "modelRef": "#/components/schemas/PaymentsCsvStateEnum",
              "customType": "PaymentsCsvStateEnum",
              "schema": []
            },
            {
              "name": "execs",
              "kind": "optional",
              "type": "array",
              "nullable": true,
              "description": "A list of payment executor type names to filter by. Defaults to an empty list if not provided.",
              "example": "[\"CyberSourcePaymentExec\"]",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "startDate",
              "kind": "optional",
              "type": "string<date-time>",
              "nullable": true,
              "description": "<p>The start date for filtering payments (ISO 8601 format). Defaults to epoch if not provided.</p>",
              "example": "2023-01-01T00:00:00Z",
              "format": "date-time"
            },
            {
              "name": "endDate",
              "kind": "optional",
              "type": "string<date-time>",
              "nullable": true,
              "description": "<p>The end date for filtering payments (ISO 8601 format). Defaults to now if not provided.</p>",
              "example": "2023-01-01T23:59:59Z",
              "format": "date-time"
            }
          ],
          "modelRef": "#/components/schemas/PaymentsCsvRequest",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "NoChannelPortalAccess",
          "name": "NoChannelPortalAccess",
          "kind": "optional",
          "type": "http",
          "description": "<p>This authentication is required for clients to interact with any of the management APIs. Similar to 'LoggedIn', it indicates that the user has actually logged into the system, but in this case with a management role.</p>",
          "scheme": "bearer"
        },
        {
          "id": "ApiKeyAccess",
          "name": "X-Upstart-Api-Key",
          "kind": "optional",
          "type": "apiKey",
          "description": "Api key based authorization.",
          "in": "header"
        },
        {
          "id": "SessionIdAccess",
          "name": "X-Upstart-Session-Id",
          "kind": "optional",
          "type": "apiKey",
          "description": "<p>Session based authorization. This authentication is required for clients to interact with any of the management APIs. Similar to 'LoggedIn', it indicates that the user has actually logged into the system, but in this case with a management role.</p>",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "<p>Success - CSV file with order payment data returned.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "headers": [
          {
            "kind": "optional",
            "name": "Content-Type",
            "type": "string",
            "example": "text/csv",
            "description": "The media type of the response."
          },
          {
            "kind": "optional",
            "name": "Content-Disposition",
            "type": "string",
            "example": "attachment;filename=payments.csv",
            "description": "Specifies that the response is an attachment with a filename."
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "The request contained information that the server was unable to process. Appropriate errors are provided in the response body.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "ValidationErrorResponse",
            "schema": [
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "detail",
                "kind": "optional",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/ValidationErrorResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "The provided credentials were not valid for this endpoint. It may be that they are expired or that the user's roles are insufficient.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "ErrorResponse",
            "schema": [
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "detail",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "reason",
                "kind": "optional",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/ErrorResponse",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "y_WaFwwL5--IFxxjtSgLH",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.upstartcommerce.com/v1/order/payments/csv \\\n     --header 'accept: text/csv' \\\n     --header 'x-upstart-tenant: string' \\\n     --header 'x-upstart-site: string'"
        },
        {
          "id": "eM5v8MgN669QK8HigziQ3",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"text/csv\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-upstart-tenant\", \"string\");\nmyHeaders.append(\"x-upstart-site\", \"string\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.upstartcommerce.com/v1/order/payments/csv\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "842BQM-iKsZrMZ1v3f-7G",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.upstartcommerce.com/v1/order/payments/csv\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"text/csv\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-upstart-tenant\"] = \"string\"\nrequest[\"x-upstart-site\"] = \"string\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "a4rQoHpQZiWmMa4UYW5g6",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.upstartcommerce.com/v1/order/payments/csv\"\n\npayload = {}\nheaders = {\n   'accept': 'text/csv',\n   'content-type': 'application/json',\n   'x-upstart-tenant': 'string',\n   'x-upstart-site': 'string'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "y_WaFwwL5--IFxxjtSgLH"
    },
    "results": {
      "languages": [
        {
          "id": "lC2guIG6Tmxd9RN7luxBT",
          "language": "200",
          "code": "// Success - CSV file with order payment data returned.\n"
        },
        {
          "id": "0lXRsfKDo2_LZhRJ4yjC4",
          "language": "400",
          "code": "// The request contained information that the server was unable to process. Appropriate errors are provided in the response body.\n{\n  \"name\": \"\",\n  \"code\": \"\",\n  \"detail\": \"\"\n}"
        },
        {
          "id": "Du_rZDH4mMbwAFWdlhlw1",
          "language": "401",
          "code": "// The provided credentials were not valid for this endpoint. It may be that they are expired or that the user's roles are insufficient.\n{\n  \"name\": \"\",\n  \"code\": \"\",\n  \"detail\": \"\",\n  \"reason\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "lC2guIG6Tmxd9RN7luxBT"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}