Rotate the API key
/account/integrations/api_key/rotateCosts 2 rate-limit points · Rate limits
Replace the store's API key with a new one and return it. The old key stops working at once, including for the request that rotated it. The key is shown only in this response.
Every integration using the old key must be updated. Not offered to assistants. Send it first without confirm: nothing changes and the 409 confirmation_required says what would. Tell the merchant, ask, and resend with confirm: true (?confirm=true on a DELETE) only after they agree.
Also searched asrotate api keyregenerate api keynew api keyreset api keymy api key was leaked
Request body
confirmbooleanSend true only after the merchant agreed. Without it the key is kept and the 409 says what would happen.
Returns
api_keyobjectShow 2 child attributesHide child attributes
configuredbooleanExample:truekeystringExample:if_api_key_YOUR_KEY
payment_processorobjectShow 3 child attributesHide child attributes
connectedbooleanExample:falsenamestring, nullablestripe_checkout_v2booleanExample:false
customer_accountsobjectShow 1 child attributeHide child attributes
translationsarray of anys
Errors
Missing or unknown X-Auth-Token, or the shop uninstalled the app.
v3_required: the shop still runs the previous dashboard. paid_plan_required: API access needs a paid plan.
The request failed validation. Nothing was saved.
Rate limited: cost-weighted per key (reads cost less than writes). Wait Retry-After seconds; see X-RateLimit-* headers.
Every error has the same shape: see Errors.
curl -X POST "https://app.invoicefalcon.com/api/v3/external/account/integrations/api_key/rotate" \
-H "X-Auth-Token: $INVOICE_FALCON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"confirm": true
}'const res = await fetch("https://app.invoicefalcon.com/api/v3/external/account/integrations/api_key/rotate", {
method: "POST",
headers: {
"X-Auth-Token": process.env.INVOICE_FALCON_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"confirm": true
}),
});
const data = await res.json();import os
import requests
res = requests.post(
"https://app.invoicefalcon.com/api/v3/external/account/integrations/api_key/rotate",
headers={"X-Auth-Token": os.environ["INVOICE_FALCON_API_KEY"]},
json={
"confirm": True
},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.invoicefalcon.com/api/v3/external/account/integrations/api_key/rotate")
req = Net::HTTP::Post.new(uri, "X-Auth-Token" => ENV["INVOICE_FALCON_API_KEY"], "Content-Type" => "application/json")
req.body = {
confirm: true
}.to_json
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body){
"api_key": {
"configured": true,
"key": "if_api_key_YOUR_KEY"
},
"payment_processor": {
"connected": false,
"name": null,
"stripe_checkout_v2": false
},
"customer_accounts": {
"translations": []
}
}{
"errors": [
"Invalid API key"
],
"code": "unauthorized"
}{
"errors": [
"API access requires a paid plan"
],
"code": "paid_plan_required"
}{
"errors": [
"id is missing"
]
}{
"errors": [
"Rate limit exceeded"
],
"code": "rate_limited"
}