DEVELOPER GUIDE
How to integrate
API Only Initiation
8 min
api invocation method https //docs klavipay ai/docs/dev guides/integration api/api#api invocation method request uri https //docs klavipay ai/docs/dev guides/integration api/api#request uri the request uri consists of the following parts parameter description in uri parameter description uri scheme all apis use https protocol, only support https host different environments have different host sandbox environment api sandbox klavi ai testing environment api testing klavi ai production environment api klavi ai resource path resource path, i e api access path apis with different functions have different resource paths for example\ the resource path of the product api is payment/customer/v1/auth the resource path of the query string query parameters are optional not every api has query parameters query parameters need to be preceded by a "?", the form is parameter name=parameter value for example, ?limit=10 , which means no more than 10 pieces of data can be queried caution different environments have different host , only after the successful integration test in the sandbox environment can it be integrated in the production environment sandbox environment api sandbox klavi ai/payment/customer/v1/auth testing environment api testing klavi ai/payment/customer/v1/auth production environment api klavi ai/payment/customer/v1/auth the credentials of the production environment is different from the sandbox environment , please reach out to us at crie\@klavi ai request method https //docs klavipay ai/docs/dev guides/integration api/api#request method supported http request methods post and get for get method, only content type application/x www form url encoded protocol format is supported for post method, only content type application/json is supported at present character encoding https //docs klavipay ai/docs/dev guides/integration api/api#character encoding utf 8 coding start integrating klavi payment step 1 authentication before request the klavi payment api, you must first obtain a jwt bearer token by request the auth, once you have a jwt bearer token you can submit requests on protected apis like participants and payments curl request example curl location request post 'https //api sandbox klavi ai/payment/customer/v1/auth' \\ \ header 'content type application/json' \\ \ data raw '{ "accesskey" "k0l1l2v3i4", "secretkey" "ttmdrh\&a8mjd9fyulnfs #dypax15%qpxtxqt2n$" }' response example { 	"accesstoken" "eyjhbgcioijfuzi1niisinr5cci6ikpxvcj9 eyjwyxlsblwdhdgv3yxkifq 2dvwmbcu87iex4j7s1 bx1ukhsxavsdak0rdv9xq3 osrla", "expireat" 1752053847 } refer generate access token docid\ v0fheyr y6wb udvdbavy step 2 list account providers https //docs klavipay ai/docs/dev guides/integration api/api#step 2 list account providers now that you have an access token, you can display the list of account providers participating in open finance to users after the user selects his account holding institution, all you need to do is save the id for later use on the payments api curl request example curl l x get 'https //api sandbox klavi ai/payment/customer/v1/institutions' \\ \ header 'content type application/json' \\ \ header 'accept application/json' \\ \ header 'authorization bearer 6ikpxvcj9 eyjwywdhdgv3yxkifq fkx8rt3jiffeolytgtrzlsbojmimpazipkh4vdhl nb' response example \[ 	{ 	 "id" "81bada34 a509 43d6 9ac3 23f95b066411", 	 "name" "mock bank 1", 	 "avatar" "https //example server com/mockbank1 svg", 	 "description" "mock sandbox 1", 	 "businesstype" "pj", 	 "outage" false, 	 "outagereason" "outage a litte time", 	 "authmethod" \["redirection", "bio metric"], 	 'parentorganizationname' 'testtest001', 'parentorganizationid' '1234124', 'organizationname' 'test001', 'organizationid' '56789' 	}, 	{ 	 "id" "81bada34 a509 43d6 9ac3 23f95b066411", 	 "name" "mock bank 2", 	 "avatar" "https //example server com/mockbank2 svg", 	 "description" "mock sandbox 2", 	 "businesstype" "pj", 	 "outage" false, 	 "outagereason" "outage a litte time", 	 "authmethod" \["redirection", "bio metric"], 	 'parentorganizationname' 'testtest001', 'parentorganizationid' '1234124', 'organizationname' 'test001', 'organizationid' '56789' 	} ] refer get a list of institutions docid\ lsqdeooxxxfgolhpiq3rz step 3 send payment payload now that you have a jwt access token and the participantid that the end user selected, it's time to show the checkout and to get the user confirmation on the payment transaction once confirmed, you need to send the payload of the payment to be enqueued and then processed the example below displays the minimum payload information required curl location request post 'https //api sandbox klavi ai/payment/customer/v1/payments' \\ \ header 'accept application/json' \\ \ header 'authorization bearer 6ikpxvcj9 eyjwywdhdgv3yxkifq fkx8rt3jiffeolytgtrzlsbojmimpazipkh4vdhl nb ' \\ \ data raw '{ "institutionid" "c8f0bf49 4744 4933 8960 7add6e590841", "clientrequestid" "1", "customer" { "identifiertype" "cpf", "identifier" "12345678901", "name" "klavi test" }, "date" "2025 07 01", "inittype" "pix inic", "proxy" "12345678901", "amount" "1333 00", "currency" "brl", "redirecturl" "http //test", "clientmetadata" { "os" "macos", "osversion" "3 2 1", "platform" "browser" } }' response example { "id" "fcb72e3a b346 4f71 b044 971dc23232c9", "clientrequestid" "fcb72e3a b346 4f71 b044 dsndsnmnkdsmk", "amount" "1333 04", "currency" "brl", "status" "consent awaiting authorization", "statusreason" { "code" "nao informado", "message" "erro não informado na iniciadora ou detentora de conta " }, "consentredirecturl" "https //server example com/cb" } refer create a payment initiation docid\ n8ffvkuq0ltrayzj5rn9r step 4 check status until completed, rejected or error congratulations, you have now sent the payload of the payment initiation! now you can check the payment initiation status through the endpoint /payments/\ id/status it only returns information to direct your next steps polling should be done in a few seconds intervals a happy path should display the responses below, in this exact order curl l x get 'https //api sandbox klavi ai/payment/customer/v1/payments/fcb72e3a b346 4f71 b044 971dc23232c9/status' \\ \ header 'accept application/json' \\ \ header 'authorization bearer 6ikpxvcj9 eyjwywdhdgv3yxkifq fkx8rt3jiffeolytgtrzlsbojmimpazipkh4vdhl nb' response { "id" "cfa45795 fe16 48e2 a372 130e30a72606", "clientrequestid" "1a3s2aebe29s2", "amount" "1333 04", "currency" "brl", "status" "consent authoried", "statusreason" { "code" "nao informado", "message" "erro não informado na iniciadora ou detentora de conta " }, "statusupdateat" "2022 09 23t03 39 43 737z" } refer await for payment status docid\ eveee8jqvwcwaymy23qt9 if there is any problem in the integration, we will provide support in the way you think is most appropriate, not limited to slack, teams or email, please reach out to us at crie\@klavi ai api call sequence diagram