Skip to main content

Update Payment Access

Updates the store's default payment access for one or more buyer types, and optionally the order in which payment methods are shown at checkout. Buyer types you do not send keep their current settings.

HTTP Request​

  • URL: /paymentAccess
  • Method: PUT
  • Headers:
    • accessToken: Required. Your API access token.
    • Content-Type: application/json
  • Required scope: READ_WRITE_PAYMENT

Request Body​

Send at least one of the following fields:

FieldTypeRequiredDescription
guestObjectNoSettings for shoppers who are not signed in. See below.
b2cObjectNoSettings for signed-in customers without a company.
b2bObjectNoSettings for customers who belong to a company.
methodOrderArrayNoPayment method IDs in the order they should be shown. Replaces the current order.

Access Object​

FieldTypeRequiredDescription
modeStringYesinherit (no restriction) or selected (only the listed methods).
methodsArrayNoAllowed payment methods when mode is selected. See below.

Method Object​

FieldTypeRequiredDescription
methodStringYesPayment method ID. See Get All Payment Methods.
typesArrayNoPayment types to allow, for example card. Use lowercase letters and underscores. Leave empty to allow all types.

The same access object can be sent as paymentAccess when you create or update a customer, company or company group.

cURL Example​

curl --location --request PUT '<BASE_URL>/paymentAccess' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"guest": {
"mode": "selected",
"methods": [
{ "method": "67644189a909f37370551d41", "types": ["card", "apple_pay", "google_pay"] }
]
},
"b2b": {
"mode": "selected",
"methods": [
{ "method": "67644189a909f37370551d41" },
{ "method": "67644189a909f37370551d44" }
]
},
"methodOrder": ["67644189a909f37370551d44", "67644189a909f37370551d41"]
}'

Response​

  • 200 OK: The payment access settings were updated successfully.
  • 401 Unauthorized: The access token is missing or invalid.
  • 403 Forbidden: The access token does not have the required scope.
  • 400 Bad Request: The request body is empty or a field is not valid.

Sample JSON Response​

{
"success": true,
"message": "Payment access updated successfully",
"data": {
"guest": {
"mode": "selected",
"methods": [
{ "method": "67644189a909f37370551d41", "types": ["card", "apple_pay", "google_pay"] }
]
},
"b2c": {
"mode": "inherit",
"methods": []
},
"b2b": {
"mode": "selected",
"methods": [
{ "method": "67644189a909f37370551d41", "types": [] },
{ "method": "67644189a909f37370551d44", "types": [] }
]
},
"methodOrder": ["67644189a909f37370551d44", "67644189a909f37370551d41"]
}
}

Response Details​

FieldTypeDescription
successBooleanWhether the request was successful.
messageStringConfirmation message.
dataObjectAll payment access settings after the update. See Get Payment Access.

Notes​

  • When mode is inherit, the methods list is cleared.
  • See How Payment Access Works for how these defaults combine with customer, company and company group settings.