SecurityProfiles
SecurityProfiles let you define granular security rules applied to your App’s API requests: restriction by IP or domain, a per-transaction amount cap, a whitelist of payment methods, and blocking of high-risk countries.
Typical use cases: limiting API calls to your production servers, preventing payments beyond a certain amount from the frontend, blocking countries under embargo or with a high fraud rate.
SecurityProfiles are available on the Growth, Business, and Enterprise plans. On the Starter plan, requests are not filtered by a security profile.
Endpoints
| Méthode | Endpoint | Description |
|---|---|---|
| POST | /security-profiles/ | Create a security profile |
| GET | /security-profiles/ | List profiles |
| GET | /security-profiles/{id}/ | Retrieve a profile |
| PATCH | /security-profiles/{id}/ | Update a profile |
| DELETE | /security-profiles/{id}/ | Delete a profile |
Object schema
Create a SecurityProfile
Creates a new security profile for your App. The profile is applied immediately to all API requests as soon as it is created.
nameRequisName of the security profile. Used only for identification purposes in the dashboard — not visible to your customers.
allowed_ipsOptionnelList of IP addresses or CIDR ranges allowed to issue API requests. If this
field is set, any request coming from an unlisted IP is rejected with
a 403 Forbidden error.
En savoir plus
Accepted formats: a single IPv4 address (41.202.219.5) or
CIDR notation (196.200.1.0/24). Leave this field empty to allow all
IPs — useful if your servers don’t have a fixed IP. Combine with allowed_domains for defense in depth.
allowed_domainsOptionnelList of domains allowed to initiate requests from the browser (the Origin header). Useful for restricting the use of your public key to
only the domains you control.
En savoir plus
Do not include the protocol (https://) or the trailing slash.
Subdomains must be listed explicitly — ma-boutique.com
does not automatically allow app.ma-boutique.com. The allowed_domains field applies only to frontend requests (CORS);
server-to-server calls are not filtered by this field.
max_amountOptionnelMaximum amount allowed per transaction, in cents. Any payment attempt exceeding this threshold is rejected before being created.
En savoir plus
This cap applies to the raw amount of the PaymentIntent, before discounts or taxes.
Leave this field as null to not apply a cap. Useful for
limiting exposure in case of API key compromise, or for merchants
subject to regulatory per-transaction limits.
allowed_payment_methodsOptionnelList of payment methods allowed by this profile. If set, only the listed methods can be used in transactions associated with this App.
En savoir plus
Possible values: mobile_money, bank_card, bank_transfer. If this field is empty or omitted, all of the App’s
active methods are allowed. Restricting to the methods actually offered
on your interface reduces the attack surface.
blocked_countriesOptionnelList of country codes whose payments are blocked. Any transaction initiated from an IP geolocated in a blocked country is rejected.
En savoir plus
Uppercase ISO 3166-1 alpha-2 codes (e.g. KP, IR, SY). Geolocation is based on the buyer’s IP — not
bypassable via VPN in most cases thanks to anomaly detection.
This list is independent of your App’s restrictions; a country can be
blocked here without being removed from your catalog.
Create a restrictive profile
List SecurityProfiles
Returns all of your App’s security profiles, sorted by descending creation date.
Update a SecurityProfile
Updates one or more fields of an existing profile. Changes are applied immediately — subsequent requests are filtered according to the new rules.
nameOptionnelallowed_ipsOptionnelNew complete list of allowed IPs. Entirely replaces
the existing list — this is not a merge. Pass an empty array [] to remove all IP restrictions.
allowed_domainsOptionnelNew complete list of allowed domains. Entirely replaces the existing
list. Pass [] to remove domain restrictions.
max_amountOptionnelNew amount cap. Pass null to remove the cap.
allowed_payment_methodsOptionnelNew list of allowed methods. Entirely replaces the existing list.
blocked_countriesOptionnelNew list of blocked countries. Entirely replaces the existing list. Pass [] to unblock all countries.
Delete a SecurityProfile
Permanently deletes the security profile. The associated rules immediately stop being applied. This action is irreversible.
Deleting a SecurityProfile takes effect instantly: your App is no longer subject to any security restrictions until a new profile is created and activated. Make sure you have a replacement profile ready before deleting a production profile.
List profiles
Update a profile
Delete a profile