Skip to content

Create a GeoIP country rule

POST
/v1/merchants/{merchant_id}/projects/{project_id}/fraud-prevention/rules/countries/

Blocks payments of customers whose IP address is located in this country. GeoIP lookups are about 99.8% accurate at country level. Payments without a customer IP address aren't checked.

Authorization

apiKey
headerAuthorizationBasic <token>

HTTP Basic authentication with your API key as the username and an empty password.

Path Parameters

merchant_id*string

The ID of the merchant, or self for the merchant of your API key.

project_id*string

The ID of the project.

Request Body

application/json
  1. body

Blocks customers whose IP address is located in a country.

country_code*string

The country of the customer's IP address, as an ISO 3166-1 alpha-2 code.

Length2 <= length <= 2

Response Body

The rule is created.

application/json
  1. response

Blocks customers whose IP address is located in a country.

rule_id?string

The ID of the rule.

country_code*string

The country of the customer's IP address, as an ISO 3166-1 alpha-2 code.

Length2 <= length <= 2
curl -X POST 'https://api.example.com/v1/merchants/b8a1c2d4-1234-4c5d-9e8f-0123456789ab/projects/c5078bef-f741-4f26-a13f-26e7916bb00c/fraud-prevention/rules/countries/' \  --user "$API_KEY:" \  -H 'Content-Type: application/json' \  -d '{  "country_code": "NL"}'
{  "rule_id": "string",  "country_code": "st"}