---
title: Get all orders from an consent
slug: payment/get-all-orders-from-an-consent
docTags: 
createdAt: 2025-11-05T06:49:57.160Z
---

:::ApiMethodV2
```json
{
  "name": "Get all orders from an consent",
  "method": "GET",
  "url": "https://api-sandbox.klavi.ai/payment/management/v1/merchants/automatic/{appId}/consents/{consentId}/orders",
  "description": "Returns the paged list of the orders created through the given automatic PIX consent",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "AsEa13tnUdCnkw0UkgxUH",
        "language": "curl",
        "code": "curl --location --globoff 'https://api-sandbox.klavi.ai/payment/management/v1/merchants/automatic/{appId}/consents/{consentId}/orders' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json'",
        "customLabel": ""
      },
      {
        "id": "qVL69TDh0_bWuXc-F8kUI",
        "language": "nodejs",
        "code": "var request = require('request');\nvar options = {\n   'method': 'GET',\n   'url': 'https://api-sandbox.klavi.ai/payment/management/v1/merchants/automatic/{appId}/consents/{consentId}/orders',\n   'headers': {\n      'Accept': 'application/json',\n      'Content-Type': 'application/json'\n   }\n};\nrequest(options, function (error, response) {\n   if (error) throw new Error(error);\n   console.log(response.body);\n});\n",
        "customLabel": ""
      },
      {
        "id": "ms6ofgCoDcgs3klUzWgoc",
        "language": "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://api-sandbox.klavi.ai/payment/management/v1/merchants/automatic/{appId}/consents/{consentId}/orders\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));",
        "customLabel": ""
      },
      {
        "id": "Ih0DyuNIPcwWSmQ2VwBwH",
        "language": "python",
        "code": "import requests\nimport json\n\nurl = \"https://api-sandbox.klavi.ai/payment/management/v1/merchants/automatic/{appId}/consents/{consentId}/orders\"\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",
        "customLabel": ""
      },
      {
        "id": "39KExMbHvVpOc3Aa17Xxf",
        "language": "ruby",
        "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api-sandbox.klavi.ai/payment/management/v1/merchants/automatic/{appId}/consents/{consentId}/orders\")\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",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "AsEa13tnUdCnkw0UkgxUH"
  },
  "results": {
    "languages": [
      {
        "id": "rD19O3FIGr2RIMmu85YkM",
        "language": "200",
        "code": "{\n    \"data\": [\n        {\n            \"id\": \"bd4de72f-550b-421b-ba5c-28190e754d58\",\n            \"appId\": \"ax2regress\",\n            \"clientRequestId\": \"retry15\",\n            \"institutionId\": \"c8f0bf49-4744-4933-8960-7add6e590841\",\n            \"customer\": {\n                \"identifierType\": \"CPF\",\n                \"identifier\": \"***.092.776-**\",\n                \"name\": \"Kbms 10086\",\n                \"phone\": \"12*******00\",\n                \"email\": \"q***@klavi.ai\"\n            },\n            \"date\": \"2025-09-08\",\n            \"consentId\": \"17d9d5be-073f-4706-86d4-8fdd36b90aed\",\n            \"endToEndId\": \"E4445979920250908132600000000005\",\n            \"ibgeTownCode\": \"\",\n            \"amount\": \"90.1200\",\n            \"currency\": \"BRL\",\n            \"remittanceInformation\": \"batata\",\n            \"debtorAccount\": {\n                \"ispb\": \"\",\n                \"issuer\": \"\",\n                \"number\": \"\",\n                \"accountType\": \"\"\n            },\n            \"creditorAccount\": {\n                \"ispb\": \"00000000\",\n                \"issuer\": \"****\",\n                \"number\": \"******\",\n                \"accountType\": \"CACC\",\n                \"holder\": {\n                    \"identifier\": \"**.***.708/0001-**\",\n                    \"identifierType\": \"CNPJ\",\n                    \"name\": \"John Doe\"\n                }\n            },\n            \"externalInfo\": {\n                \"batata\": \"batata\"\n            },\n            \"cancellation\": {\n                \"cancelledFrom\": \"\",\n                \"cancelledAt\": \"\",\n                \"cancelledBy\": {\n                    \"identifier\": \"\",\n                    \"identifierType\": \"\"\n                }\n            },\n            \"status\": \"PAYMENT_REJECTED\",\n            \"statusReason\": {\n                \"code\": \"UNKNOWN\",\n                \"message\": \"unknown server error\"\n            },\n            \"createAt\": \"2025-09-07T22:26:14Z\",\n            \"statusUpdateAt\": \"2025-09-07T22:26:48Z\",\n            \"firstPayment\": false,\n            \"originalPaymentId\": \"6aef77ea-f4e1-44c2-92af-f5cda0413154\",\n            \"paymentReference\": \"03-09-2025/P1M\"\n        }\n    ],\n    \"paging\": {\n        \"nextCursor\": \"XX3tSz4UQ9c70Kuy63wUtKL8JJdY-MPgS6e4dgr6PQ3eXHXGalTDvpRDqPb7HlnVceMtez3ctA3Td-ncikHTXw\",\n        \"prevCursor\": \"\",\n        \"hasNext\": true,\n        \"hasPrev\": false\n    }\n}",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "rD19O3FIGr2RIMmu85YkM"
  },
  "request": {
    "pathParameters": [
      {
        "name": "appId",
        "kind": "required",
        "type": "string",
        "description": "ID of application for partner",
        "": "required"
      },
      {
        "name": "consentId",
        "kind": "required",
        "type": "string",
        "description": "ID of consent",
        "": "ID of consent"
      }
    ],
    "queryParameters": [
      {
        "name": "startDate",
        "kind": "optional",
        "type": "string",
        "description": "Start date\nfor example: 2025-06-01",
        "": "Start date\nfor example: 2025-06-01"
      },
      {
        "name": "endDate",
        "kind": "optional",
        "type": "string",
        "description": "End date\nfor example: 2025-06-01",
        "": "End date\nfor example: 2025-06-01"
      },
      {
        "name": "pageSize",
        "kind": "optional",
        "type": "string",
        "description": "Page size(default:20, Max: 200)",
        "": "Page size(default:20, Max: 200)"
      },
      {
        "name": "cursor",
        "kind": "optional",
        "type": "string",
        "description": "Page cursor",
        "": "Page cursor"
      }
    ],
    "headerParameters": [
      {
        "name": "Authorization",
        "kind": "required",
        "type": "string",
        "description": "Bearer access token, it returned by the /auth",
        "": "Bearer access token, it returned by the /auth"
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Header Parameter",
    "value": "headerParameters"
  },
  "hasTryItOut": false,
  "response": [
    {
      "name": "data",
      "kind": "optional",
      "type": "object",
      "description": "",
      "children": [
        {
          "name": "id",
          "kind": "optional",
          "type": "string",
          "description": ""
        },
        {
          "name": "appId",
          "kind": "optional",
          "type": "string",
          "description": "App ID for partner"
        },
        {
          "name": "clientRequestId",
          "kind": "optional",
          "type": "string",
          "description": "Your internal orderId. Only can be used for once. \nyou can use it to associate a payment and you can use UUID generation algorithm to generate it"
        },
        {
          "name": "institutionId",
          "kind": "optional",
          "type": "string",
          "description": "Id from the bank chosen by the user"
        },
        {
          "name": "customer",
          "kind": "optional",
          "type": "object",
          "description": "Id from the bank chosen by the user",
          "children": [
            {
              "name": "identifierType",
              "kind": "optional",
              "type": "string",
              "description": "Type of the user identification document: CNPJ or CPF\nIf value is CPF:\nmaxLength: 3\nexample: CPF\npattern: ^[A-Z]{3}$\n\nIf value is CNPJ\nmaxLength: 4\nexample: CNPJ\npattern: ^[A-Z]{4}$"
            },
            {
              "name": "identifier",
              "kind": "optional",
              "type": "string",
              "description": "The number of the user identification document\nIf identifierType value is CPF:\nmaxLength: 11\nexample: 11111111111\npattern: ^\\d{11}$\n\nIf identifierType value is CNPJ:\nmaxLength: 14\nexample: 11111111111111\npattern: ^\\d{14}$"
            },
            {
              "name": "name",
              "kind": "optional",
              "type": "string",
              "description": "Username"
            },
            {
              "name": "phone",
              "kind": "optional",
              "type": "string",
              "description": "User's phone number"
            },
            {
              "name": "email",
              "kind": "optional",
              "type": "string",
              "description": "User's email"
            }
          ]
        },
        {
          "name": "date",
          "kind": "optional",
          "type": "string",
          "description": "maxLength: 10\npattern: ^(\\d{4})-(1[0-2]|0?[1-9])-(3[01]|[12][0-9]|0?[1-9])$\nexample: 2021-01-01\nDate of payment creation"
        },
        {
          "name": "consentId",
          "kind": "optional",
          "type": "string",
          "description": "pattern: ^urn:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,31}:[a-zA-Z0-9()+,\\-.:=@;$_!*'%\\/?#]+$\nmaxLength: 256\nConsent Id"
        },
        {
          "name": "endToEndId",
          "kind": "optional",
          "type": "string",
          "description": "minLength: 32\nmaxLength: 32\npattern: ^([E])([0-9]{8})([0-9]{4})(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])(2[0-3]|[01][0-9])([0-5][0-9])([a-zA-Z0-9]{11})$\nexample: E9040088820241225150000123873170\nIt should be filled in the default format ExxxxxxxxyyyyMMddHHmmkkkkkkkkk (32 characters; \"case sensitive\", i.e., case sensitive)"
        },
        {
          "name": "ibgeTownCode",
          "kind": "optional",
          "type": "string",
          "description": "ibge town code\nminLength: 7\nmaxLength: 7\npattern: ^\\d{7}$\nexample: 5300108"
        },
        {
          "name": "amount",
          "kind": "optional",
          "type": "string",
          "description": "Amount that will be paid by the user\nminLength: 4\nmaxLength: 19\npattern: ^((\\d{1,16}\\.\\d{2}))$\nexample: 100000.12\n[Restriction] The value with 2 decimal places."
        },
        {
          "name": "currency",
          "kind": "optional",
          "type": "string",
          "description": "maxLength: 3\npattern: ^([A-Z]{3})$\nexample: BRL\nNational currency code according to ISO-4217, i.e., 'BRL'. All reported monetary values are represented with the current currency of Brazil."
        },
        {
          "name": "remittanceInformation",
          "kind": "optional",
          "type": "string",
          "description": "Payment description\nmaxLength: 140\npattern: [\\w\\W\\s]*\nexample: Pagamento da nota XPTO035-002.\nIt must be filled in whenever the paying user enters some additional information in a payment, to be sent to the recipient."
        },
        {
          "name": "debtorAccount",
          "kind": "optional",
          "type": "object",
          "description": "Payer's origin account information",
          "children": [
            {
              "name": "ispb",
              "kind": "optional",
              "type": "string",
              "description": "minLength: 8\nmaxLength: 8\npattern: ^[0-9]{8}$\nexample: 12345678\nIt must be filled in with the ISPB (Brazilian Payment System Identifier) of the SPI participant (Instant Payment System) with numbers only."
            },
            {
              "name": "issuer",
              "kind": "optional",
              "type": "string",
              "description": "minLength: 1\nmaxLength: 4\npattern: ^[0-9]{1,4}$\nexample: 1774\nCode of the Agency issuing the account without digit.\n [Restriction] Mandatory for the following account types: CACC (CONTA_DEPOSITO_A_VISTA) and SVGS (CONTA_POUPANCA)."
            },
            {
              "name": "number",
              "kind": "optional",
              "type": "string",
              "description": "minLength: 1\nmaxLength: 20\npattern: ^[0-9]{1,20}$\nexample: 1234567890\nIt must be filled in with the paying user's transactional account number, with verification digit (if any),\nIf there is an alphanumeric value, it should be converted to 0."
            },
            {
              "name": "accountType",
              "kind": "optional",
              "type": "string",
              "description": "Types of accounts used for payment.\nexample: CACC\nEnum: [ CACC, SVGS, TRAN]\n    CACC - Current - Current Account\n    SVGS - Savings - Saving Account\n    TRAN - TransactingAccount - Prepaid Payment Account"
            }
          ]
        },
        {
          "name": "creditorAccount",
          "kind": "optional",
          "type": "object",
          "description": "",
          "children": [
            {
              "name": "ispb",
              "kind": "optional",
              "type": "string",
              "description": "minLength: 8\nmaxLength: 8\npattern: ^[0-9]{8}$\nexample: 12345678\nIt must be filled in with the ISPB (Brazilian Payment System Identifier) of the SPI participant (Instant Payment System) with numbers only."
            },
            {
              "name": "issuer",
              "kind": "optional",
              "type": "string",
              "description": "minLength: 1\nmaxLength: 4\npattern: ^[0-9]{1,4}$\nexample: 1774\nCode of the Agency issuing the account without digit.\n [Restriction] Mandatory for the following account types: CACC (CONTA_DEPOSITO_A_VISTA) and SVGS (CONTA_POUPANCA)."
            },
            {
              "name": "number",
              "kind": "optional",
              "type": "string",
              "description": "minLength: 1\nmaxLength: 20\npattern: ^[0-9]{1,20}$\nexample: 1234567890\nIt must be filled in with the paying user's transactional account number, with verification digit (if any),\nIf there is an alphanumeric value, it should be converted to 0."
            },
            {
              "name": "accountType",
              "kind": "optional",
              "type": "string",
              "description": "Types of accounts used for payment.\nexample: CACC\nEnum: [ CACC, SVGS, TRAN]\n    CACC - Current - Current Account\n    SVGS - Savings - Saving Account\n    TRAN - TransactingAccount - Prepaid Payment Account"
            },
            {
              "name": "holder",
              "kind": "optional",
              "type": "object",
              "description": "Holder object",
              "children": [
                {
                  "name": "identifier",
                  "kind": "optional",
                  "type": "string",
                  "description": "The number of the user identification document\nIf identifierType value is CPF:\nmaxLength: 11\nexample: 11111111111\npattern: ^\\d{11}$\n\nIf identifierType value is CNPJ:\nmaxLength: 14\nexample: 11111111111111\npattern: ^\\d{14}$"
                },
                {
                  "name": "identifierType",
                  "kind": "optional",
                  "type": "string",
                  "description": "Type of the user identification document: CNPJ or CPF\nIf value is CPF:\nmaxLength: 3\nexample: CPF\npattern: ^[A-Z]{3}$\n\nIf value is CNPJ\nmaxLength: 4\nexample: CNPJ\npattern: ^[A-Z]{4}$"
                },
                {
                  "name": "name",
                  "kind": "optional",
                  "type": "string",
                  "description": "Username"
                }
              ]
            }
          ]
        },
        {
          "name": "externalInfo",
          "kind": "optional",
          "type": "object",
          "description": "Metadata, user customizable"
        },
        {
          "name": "cancellation",
          "kind": "optional",
          "type": "object",
          "description": "Object containing the data relating to the paying user who requested the cancellation, the channel used by him and the reason.",
          "children": [
            {
              "name": "cancelledFrom",
              "kind": "optional",
              "type": "string",
              "description": "example: INITIATOR\nEnum:\n [ INITIATOR, HOLDER ]"
            },
            {
              "name": "cancelledAt",
              "kind": "optional",
              "type": "string",
              "description": "maxLength: 20\npattern: ^(\\d{4})-(1[0-2]|0?[1-9])-(3[01]|[12][0-9]|0?[1-9])T(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)Z$\nexample: 2021-05-21T08:30:00Z"
            },
            {
              "name": "cancelledBy",
              "kind": "optional",
              "type": "object",
              "description": "Cancel object",
              "children": [
                {
                  "name": "identifier",
                  "kind": "optional",
                  "type": "string",
                  "description": "The number of the user identification document\nIf identifierType value is CPF:\nmaxLength: 11\nexample: 11111111111\npattern: ^\\d{11}$\n\nIf identifierType value is CNPJ:\nmaxLength: 14\nexample: 11111111111111\npattern: ^\\d{14}$"
                },
                {
                  "name": "identifierType",
                  "kind": "optional",
                  "type": "string",
                  "description": "Type of the user identification document: CNPJ or CPF\nIf value is CPF:\nmaxLength: 3\nexample: CPF\npattern: ^[A-Z]{3}$\n\nIf value is CNPJ\nmaxLength: 4\nexample: CNPJ\npattern: ^[A-Z]{4}$"
                }
              ]
            }
          ]
        },
        {
          "name": "status",
          "kind": "optional",
          "type": "string",
          "description": "Consent status"
        },
        {
          "name": "statusReason",
          "kind": "optional",
          "type": "object",
          "description": "Status reason object",
          "children": [
            {
              "name": "code",
              "kind": "optional",
              "type": "string",
              "description": "example: CONSENT_AWAITING_AUTHORIZATION\nEnum:\n[NOT_INFORMED,INFRASTRUCTURE_FAILURE,AUTHORIZATION_EXPIRED_TIME, USER_REJECTED, ORIGIN_DESTINATION_ACCOUNTS_EQUAL, ACCOUNT_DOES_NOT_ALLOW_PAYMENT, DIVERGENT_AUTHENTICATION, NOT_INFORMED, REVOKED_USER, REVOKED_MERCHANT ]"
            },
            {
              "name": "message",
              "kind": "optional",
              "type": "string",
              "description": "pattern: [wWs]*\nLength: 2048\nexample: User refused consent\nStatus message"
            }
          ]
        },
        {
          "name": "createAt",
          "kind": "optional",
          "type": "string",
          "description": "maxLength: 20\npattern: ^(\\d{4})-(1[0-2]|0?[1-9])-(3[01]|[12][0-9]|0?[1-9])T(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)Z$\nexample: 2020-07-21T08:30:00Z"
        },
        {
          "name": "statusUpdateAt",
          "kind": "optional",
          "type": "string",
          "description": "maxLength: 20\npattern: ^(\\d{4})-(1[0-2]|0?[1-9])-(3[01]|[12][0-9]|0?[1-9])T(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)Z$\nexample: 2020-07-21T08:30:00Z"
        },
        {
          "name": "firstPayment",
          "kind": "optional",
          "type": "boolean",
          "description": "Is it a First Payment"
        },
        {
          "name": "originalPaymentId",
          "kind": "optional",
          "type": "string",
          "description": "minLength: 1\nmaxLength: 100\npattern: ^[a-zA-Z0-9][a-zA-Z0-9\\-]{0,99}$\nexample: TXpRMU9UQTROMWhZV2xSU1FUazJSMDl"
        },
        {
          "name": "paymentReference",
          "kind": "optional",
          "type": "string",
          "description": ""
        }
      ]
    },
    {
      "name": "paging",
      "kind": "optional",
      "type": "object",
      "description": "",
      "children": [
        {
          "name": "nextCursor",
          "kind": "optional",
          "type": "string",
          "description": ""
        },
        {
          "name": "prevCursor",
          "kind": "optional",
          "type": "string",
          "description": ""
        },
        {
          "name": "hasNext",
          "kind": "optional",
          "type": "string",
          "description": ""
        },
        {
          "name": "hasPrev",
          "kind": "optional",
          "type": "string",
          "description": ""
        }
      ]
    }
  ],
  "autoGeneratedAnchorSlug": "get-all-orders-from-an-consent",
  "legacyHash": "XZIIf5cM4AFqggPsmyx9J"
}
```
:::

