upsertPaymentGatewayConfig
Requires permission settings:integration:update.
Creates or updates the credentials and settings for one payment provider. Credentials are stored encrypted, and a credential field the provider does not define is refused. Enabling the gateway is a separate step: setPaymentGatewayEnabled.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation UpsertPaymentGatewayConfig($input: UpsertPaymentGatewayConfigInput!) {
upsertPaymentGatewayConfig(input: $input) {
id
configuredSecretKeys
enabledMethods
environment
isEnabled
provider
nonSecretValues {
key
value
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation UpsertPaymentGatewayConfig($input: UpsertPaymentGatewayConfigInput!) {\n upsertPaymentGatewayConfig(input: $input) {\n id\n configuredSecretKeys\n enabledMethods\n environment\n isEnabled\n provider\n nonSecretValues {\n key\n value\n }\n }\n}",
"variables": {
"input": {
"credentials": [
{
"key": "string",
"value": "string"
}
],
"environment": "LIVE",
"provider": "PEACH"
}
}
}
EOF
Variables:
{
"input": {
"credentials": [
{
"key": "string",
"value": "string"
}
],
"environment": "LIVE",
"provider": "PEACH"
}
}
Response:
{
"data": {
"upsertPaymentGatewayConfig": {
"id": "id",
"configuredSecretKeys": [
"string"
],
"enabledMethods": [
"string"
],
"environment": "LIVE",
"isEnabled": true,
"provider": "PEACH",
"nonSecretValues": [
{
"key": "string",
"value": "string"
}
]
}
}
}
upsertPaymentGatewayConfig(
input: UpsertPaymentGatewayConfigInput!
): PaymentGatewayConfigGql!
Arguments
upsertPaymentGatewayConfig.input ● UpsertPaymentGatewayConfigInput! non-null input
The gateway configuration to create or update.
Type
PaymentGatewayConfigGql object
The organization's setup for one payment provider. Secret credentials are never returned.