---
title: Get the payment resource
slug: payment/get-the-payment-resource
docTags: 
createdAt: 2025-08-28T09:36:10.650Z
---

:::ApiMethodV2
```json
{
  "name": "/consents/{consentId}/payments/{paymentId}",
  "method": "GET",
  "url": "https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{consentId}/payments/{paymentId}",
  "description": "Get the payment resouce",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "1q-ftboUQdudpnaGPhuCX",
        "language": "curl",
        "code": "curl --location --globoff 'https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{consentId}/payments/{paymentId}' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json'",
        "customLabel": ""
      },
      {
        "id": "jQitYJ5mWrN8yCFZQ-nP1",
        "language": "nodejs",
        "code": "var request = require('request');\nvar options = {\n   'method': 'GET',\n   'url': 'https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{consentId}/payments/{paymentId}',\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": "orL0ki91wfaFBZYcLQ6oK",
        "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/customer/v1/automatic/consents/{consentId}/payments/{paymentId}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));",
        "customLabel": ""
      },
      {
        "id": "DmGPs0yPJ3IXekuA4VlY8",
        "language": "python",
        "code": "import requests\nimport json\n\nurl = \"https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{consentId}/payments/{paymentId}\"\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": "RTuyY4OnWITvNe78oRS-B",
        "language": "ruby",
        "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{consentId}/payments/{paymentId}\")\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": "1q-ftboUQdudpnaGPhuCX"
  },
  "results": {
    "languages": [
      {
        "id": "LsMaAp3sBla0tRenFk9xt",
        "language": "200",
        "code": "{\n    \"id\": \"fcb72e3a-b346-4f71-b044-971dc23232c9\", // Required\n    \"appId\": \"0b59d801-08e0-4e84-9ecd-569f34e32279\", // Required\n    \"clientRequestId\": \"fcb72e3a-b346-4f71-b044-dsndsnmnkdsmk\", // Required\n    \"institutionId\": \"c8f0bf49-4744-4933-8960-7add6e590841\", // Required\n    \"consentId\": \"yyt72e3a-b846-i771-b044-971dc232ujd8\", // Required\n    \"customer\":\n    {\n        \"identifierType\": \"CPF\", // Required, CPF | CNPJ\n        \"identifier\": \"76109277673\", // Required, mask this field\n        \"name\": \"João Silva\", // Required\n        \"phone\": \"12345\", // Optional, mask this field\n        \"email\": \"123@123.com\" // Required, mask this field\n    }, // Required\n    \"date\": \"2023-01-23\", // Required, utc -3\n    \"consentId\": \"yyt72e3a-b846-i771-b044-971dc232ujd8\", // Optional\n    \"endToEndId\": \"E9040088820210128000800123873170\", // Optional after the status CONSENT_AUTHORIZED\n    \"transactionIdentification\": \"cxf0bf49-4744-4933-8960-7add6e5908cc\", // Optional\n    \"loggedUserCpf\": \"76109277673\", // required if customer.identifierType = CNPJ\n    \"ibgeTownCode\": \"5300108\", // Optional\n    \"amount\": \"1333.04\", // Required\n    \"currency\": \"BRL\", // Required\n    \"redirectURL\": \"//close\", // Optional, return url after user checkout in Klavi env\n    \"remittanceInformation\": \"Any description\", // Optinal, payment description\n    \"debtorAccount\":\n    {\n        \"ispb\": \"00000000\", // Required, ISPB (Brazilian Payment System Identifier) of the SPI (Instant Payment System)\n        \"issuer\": \"0001\", // Optional, Code of the issuing Agency of the account without digit, mask this field\n        \"number\": \"324223\", // Required, account number, mask this field\n        \"accountType\": \"CACC\" // Required, CACC(Current Account)|SVGS(Savings Account)|TRAN(TransactingAccount)\n    }, // Optinal, payer's account\n    \"creditorAccount\":\n    {\n        \"ispb\": \"00000000\", // Required\n        \"issuer\": \"0001\", // Optional, mask this field if method != PIX_MANU\n        \"number\": \"324223\", // Required, mask this field if method != PIX_MANU\n        \"accountType\": \"CACC\", // Required\n        \"holder\":\n        {\n            \"identifier\": \"76109277673\", // Required, mask this field\n            \"name\": \"John Doe\", // Required\n            \"identifierType\": \"CPF\" // Required\n        } // Required\n    }, // Required if mthod = PIX_MANU\n    \"externalInfo\":\n    {\n        \"key\": \"value\"\n    }, // Optional\n    \"cancellation\":\n    {\n        \"cancelledFrom\": \"INSTITUTION\",  // Required, the cancellation source, INITIATOR|INSTITUTION\n        \"cancelledAt\": \"2021-05-21T08:30:00Z\", // Required\n        \"cancelledBy\":\n        {\n            \"identifier\": \"11111111111\", // Required\n            \"identifierType\": \"CPF\" // Required\n        } // Required\n    }, // Required if the status is CANCELED\n    \"status\": \"CANCELED\", // Required\n    \"statusReason\": {\n        \"code\": \"NAO_INFORMADO\", // Required\n        \"message\": \"Erro não informado na iniciadora ou detentora de conta.\" // Required\n    }, // Optional\n    \"createAt\": \"2023-01-23T14:17:06.45Z\", // Required\n    \"statusUpdateAt\": \"2023-01-23T14:17:06.45Z\", // Optional\n    \"paymentMethod\": \"AUTOMATIC_PIX\", // Required\n    \"paymentMethodConfig\": {\n    \t\"firstPayment\": true, // Required\n    \t\"originalPaymentId\": \"\", // Optional\n    } // Required\n}",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "LsMaAp3sBla0tRenFk9xt"
  },
  "request": {
    "pathParameters": [
      {
        "name": "consentId",
        "kind": "required",
        "type": "string",
        "description": "pattern: ^urn:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,31}:[a-zA-Z0-9()+,\\-.:=@;$_!*'%\\/?#]+$\nmaxLength: 256\nConsent Id",
        "": "required"
      },
      {
        "name": "paymentId",
        "kind": "required",
        "type": "string",
        "description": "pattern: ^urn:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,31}:[a-zA-Z0-9()+,\\-.:=@;$_!*'%\\/?#]+$\nmaxLength: 256\nPayment Id",
        "": "required"
      }
    ],
    "queryParameters": [],
    "headerParameters": [
      {
        "name": "Authorization",
        "kind": "required",
        "type": "string",
        "description": "JWT bearer token",
        "": "JWT bearer token"
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Path Parameter",
    "value": "pathParameters"
  },
  "hasTryItOut": false,
  "response": [
    {
      "name": "id",
      "kind": "optional",
      "type": "string",
      "description": "pattern: ^urn:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,31}:[a-zA-Z0-9()+,\\-.:=@;$_!*'%\\/?#]+$\nmaxLength: 256\nPayment Id"
    },
    {
      "name": "appId",
      "kind": "optional",
      "type": "string",
      "description": "App ID for partner",
      "children": []
    },
    {
      "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",
      "children": []
    },
    {
      "name": "institutionId",
      "kind": "optional",
      "type": "string",
      "description": "Id from the bank chosen by the user",
      "children": []
    },
    {
      "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",
      "children": []
    },
    {
      "name": "customer",
      "kind": "optional",
      "type": "object",
      "description": "User (natural person) who is logged in to the payment initiator institution",
      "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",
      "children": []
    },
    {
      "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",
      "children": []
    },
    {
      "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)",
      "children": []
    },
    {
      "name": "transactionIdentification",
      "kind": "optional",
      "type": "string",
      "description": "pattern: ^[a-zA-Z0-9]{1,35}$\nmaxLength: 35\nexample: E00038166201907261559y6j6\nThis is a transaction identifier that must be transmitted intact by the payer’s PSP when generating the payment order. This information will allow the recipient to identify and correlate the transfer, when received, with the presentation of the instructions to the payer. The characters allowed in the Pix context for the txid field (EMV 62-05) are: Low case letters, from 'a' to 'z' Upper case letters, from 'A' to 'z' Decimal digits, from '0' to '9'.",
      "children": []
    },
    {
      "name": "loggedUserCpf",
      "kind": "optional",
      "type": "string",
      "description": "User (natural person) who is logged in to the Payment Initiator institution.\nrequired if customer.identifierType = CNPJ",
      "children": []
    },
    {
      "name": "ibgeTownCode",
      "kind": "optional",
      "type": "string",
      "description": "minLength: 7\nmaxLength: 7\npattern: ^\\d{7}$\nexample: 5300108\nThe ibgeTownCode field in the Pix array has the same behavior as the codMun field described in item 1.6.6 of the Pix manual. If the municipality information is not sent, the recipient's PSP will assume that there are no state and municipal holidays in the period in question;",
      "children": []
    },
    {
      "name": "amount",
      "kind": "optional",
      "type": "string",
      "description": "minLength: 4\nmaxLength: 19\npattern: ^((\\d{1,16}\\.\\d{2}))$\nexample: 100000.12\nTransaction value with 2 decimal places",
      "children": []
    },
    {
      "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",
      "children": []
    },
    {
      "name": "redirectURL",
      "kind": "optional",
      "type": "string",
      "description": "Return rediect url after user checkout in Klavi env",
      "children": []
    },
    {
      "name": "remittanceInformation",
      "kind": "optional",
      "type": "string",
      "description": "maxLength: 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.",
      "children": []
    },
    {
      "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": "Object containing the data of the recipient (creditor)",
      "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": "name",
              "kind": "optional",
              "type": "string",
              "description": "Username"
            },
            {
              "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": "externalInfo",
      "kind": "optional",
      "type": "object",
      "description": "Metadata, user customizable",
      "children": [
        {
          "name": "key",
          "kind": "optional",
          "type": "string",
          "description": ""
        }
      ]
    },
    {
      "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": "example: PAYMENT_PENDING\nEnum:\n[PAYMENT_PENDING,PAYMENT_READY_FOR_SETTLEMENT,PAYMENT_SCHEDULED,PAYMENT_SETTLEMENT_PROCESSING, PAYMENT_COMPLETED,PAYMENT_REJECTED]",
      "children": []
    },
    {
      "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",
      "children": []
    },
    {
      "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",
      "children": []
    },
    {
      "name": "paymentMethod",
      "kind": "optional",
      "type": "string",
      "description": "Fixed value: AUTOMATIC_PIX",
      "children": []
    },
    {
      "name": "paymentMethodConfig",
      "kind": "optional",
      "type": "object",
      "description": "",
      "children": [
        {
          "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"
        }
      ]
    }
  ],
  "autoGeneratedAnchorSlug": "consentsconsentidpaymentspaymentid",
  "legacyHash": "0F7P6Z2xTTN7ykmgup9x4"
}
```
:::



