Get JSON Web Key Set
Get JSON Web Key Set
The JSON Web Key Set (JWKS) is a set of keys containing the public keys used to verify JWTs in webhooks sent by MoneyKit.
The JWKS should be cached, but MoneyKit rotates its webhook keys periodically, so if an
incoming webhook's JWT has a key ID (`kid`) not contained in the cached JWKS, you should fetch
and cache the updated JWKS using this endpoint.
URL
GET
/.well-known/jwks.json
Request
curl --request GET \
--url https://api.moneykit.com/.well-known/jwks.json \
--header 'Authorization: SOME_STRING_VALUE' \
--header 'X-Client-Id: SOME_STRING_VALUE'
const options = {
method: 'GET',
headers: {'X-Client-Id': 'SOME_STRING_VALUE', Authorization: 'SOME_STRING_VALUE'}
};
fetch('https://api.moneykit.com/.well-known/jwks.json', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import requests
url = "https://api.moneykit.com/.well-known/jwks.json"
headers = {
"X-Client-Id": "SOME_STRING_VALUE",
"Authorization": "SOME_STRING_VALUE"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.moneykit.com/.well-known/jwks.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Client-Id", "SOME_STRING_VALUE")
req.Header.Add("Authorization", "SOME_STRING_VALUE")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.moneykit.com/.well-known/jwks.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["X-Client-Id"] = 'SOME_STRING_VALUE'
request["Authorization"] = 'SOME_STRING_VALUE'
response = http.request(request)
puts response.read_body
import Foundation
let headers = [
"X-Client-Id": "SOME_STRING_VALUE",
"Authorization": "SOME_STRING_VALUE"
]
let request = NSMutableURLRequest(url: NSURL(string: "https://api.moneykit.com/.well-known/jwks.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Response
{
"keys": [
{
"crv": "P-256",
"x": "KqPQ0SAYk3Zkizuap0JP6r2XcdGKSaYBsVHJgyLyOnA",
"y": "627ZZERxpVBwpjpK5U2bVboOJ2AkI0Iz_J1kmYKl7Bc",
"kty": "EC",
"alg": "ES256",
"use": "sig",
"kid": "xMtcLMEWp9GF-5A_COcTypt-tq9hkRa0oOfaruFF"
}
]
}
X-Client-Id
: string
Your client ID.
example: live_dcc75c42eb6122127356
Responses
200
JSON Web Key Set (JWKS)
keys
: array
JWKs used for validating MoneyKit-issued tokens.
Request
curl --request GET \
--url https://api.moneykit.com/.well-known/jwks.json \
--header 'Authorization: SOME_STRING_VALUE' \
--header 'X-Client-Id: SOME_STRING_VALUE'
const options = {
method: 'GET',
headers: {'X-Client-Id': 'SOME_STRING_VALUE', Authorization: 'SOME_STRING_VALUE'}
};
fetch('https://api.moneykit.com/.well-known/jwks.json', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import requests
url = "https://api.moneykit.com/.well-known/jwks.json"
headers = {
"X-Client-Id": "SOME_STRING_VALUE",
"Authorization": "SOME_STRING_VALUE"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.moneykit.com/.well-known/jwks.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Client-Id", "SOME_STRING_VALUE")
req.Header.Add("Authorization", "SOME_STRING_VALUE")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.moneykit.com/.well-known/jwks.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["X-Client-Id"] = 'SOME_STRING_VALUE'
request["Authorization"] = 'SOME_STRING_VALUE'
response = http.request(request)
puts response.read_body
import Foundation
let headers = [
"X-Client-Id": "SOME_STRING_VALUE",
"Authorization": "SOME_STRING_VALUE"
]
let request = NSMutableURLRequest(url: NSURL(string: "https://api.moneykit.com/.well-known/jwks.json")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Response
{
"keys": [
{
"crv": "P-256",
"x": "KqPQ0SAYk3Zkizuap0JP6r2XcdGKSaYBsVHJgyLyOnA",
"y": "627ZZERxpVBwpjpK5U2bVboOJ2AkI0Iz_J1kmYKl7Bc",
"kty": "EC",
"alg": "ES256",
"use": "sig",
"kid": "xMtcLMEWp9GF-5A_COcTypt-tq9hkRa0oOfaruFF"
}
]
}