Rotate merchant application payment provider API key
Replaces the stored API key credentials for the configured payment provider on the given application. The application must belong to the authenticated merchant.
curl -X PATCH "https://api.example.com/api/v1/applications/example_string/providers/stripe/api-key" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN (JWT)" \
-d '{
"apiKey": "sk_live_..."
}'
import requests
import json
url = "https://api.example.com/api/v1/applications/example_string/providers/stripe/api-key"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN (JWT)"
}
data = {
"apiKey": "sk_live_..."
}
response = requests.patch(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.example.com/api/v1/applications/example_string/providers/stripe/api-key", {
method: "PATCH",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN (JWT)"
},
body: JSON.stringify({
"apiKey": "sk_live_..."
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"apiKey": "sk_live_..."
}`)
req, err := http.NewRequest("PATCH", "https://api.example.com/api/v1/applications/example_string/providers/stripe/api-key", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN (JWT)")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.example.com/api/v1/applications/example_string/providers/stripe/api-key')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN (JWT)'
request.body = '{
"apiKey": "sk_live_..."
}'
response = http.request(request)
puts response.body
{}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Forbidden",
"message": "You don't have permission to access this resource",
"code": 403
}
{
"error": "Not Found",
"message": "The requested resource was not found",
"code": 404
}
{
"error": "Too Many Requests",
"message": "Rate limit exceeded. Please try again later",
"code": 429,
"retryAfter": 3600
}
{
"error": "Error",
"message": "Service temporarily unavailable.",
"code": 502
}
{
"error": "Error",
"message": "Request timed out.",
"code": 504
}
PATCH
/api/v1/applications/{applicationId}/providers/{providerName}/api-keyPATCH
Base URLstring
Target server for requests. Edit to use your own host.
Bearer Token (JWT)
Bearer Tokenstring
RequiredBearer token (JWT) - just enter the token, "Bearer" prefix will be added automatically
path
applicationIdstring
RequiredID of the application that owns the provider configuration.
path
providerNamestring
RequiredName identifier of the payment provider whose API key is rotated.
Content-Typestring
RequiredThe media type of the request body
Options: application/json
apiKeystring
RequiredNew provider API key.
Request Preview
Response
Response will appear here after sending the request
Authentication
header
Authorizationstring
RequiredBearer token (JWT). Authentication token required.
Path Parameters
applicationIdstring
RequiredID of the application that owns the provider configuration.
providerNamestring
RequiredName identifier of the payment provider whose API key is rotated.
Example:
stripeBody
application/json
Responses
Was this page helpful?