Blacklists

Blacklist rules help prevent your SellApp storefront from falling victim to malicious users — they allow you to block fraud attempts by preventing users from purchasing if their details match any of your blacklist rules.

On this page, we'll dive into the different blacklist endpoints you can use to manage blacklist rules programmatically. We'll look at how to create, update, and delete blacklist rules.

The blacklist model

The blacklist model contains all the information about the blacklist rules store purchase attempts check for, including the type, data, and description.

Properties

  • Name
    id
    Type
    integer
    Description

    Unique identifier for the blacklist rule.

  • Name
    type
    Type
    string
    Description

    The type of blacklist rule. Supported types:

    • ASN
    • COUNTRY
    • EMAIL
    • IP
    • WILDCARD_EMAIL
  • Name
    data
    Type
    string
    Description

    The data related to the above type. Examples:

    • ASN: AS1234
    • COUNTRY: BE
    • EMAIL: rick@astley.com
    • IP: 1.3.3.7
    • WILDCARD_EMAIL: @yahoo.com
  • Name
    description
    Type
    string
    Description

    The description of why this blacklist rule was created.

  • Name
    created_at
    Type
    timestamp
    Description

    The time at which this blacklist rule was first created.

  • Name
    updated_at
    Type
    timestamp
    Description

    The time at which this blacklist rule was last updated.

  • Name
    store_id
    Type
    integer
    Description

    The ID of the store this blacklist rule belongs to.


GET/v1/blacklists

List all blacklist rules

This endpoint allows you to retrieve a paginated list of all your blacklist rules. By default, a maximum of fifteen blacklist rules are shown per page.

Optional attributes

  • Name
    limit
    Type
    integer
    Description

    Limit the number of blacklist rules returned

  • Name
    page
    Type
    integer
    Description

    The page number you are attempting to access.

Request

GET
/v1/blacklists
$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://sell.app/api/v1/blacklists');
$request->setRequestMethod('GET');
$request->setHeaders([
  'accept' => 'application/json',
  'Authorization' => 'Bearer {ApiKeyHere}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();

Response

{
  "data": [
    {
      "id": 1,
      "type": "EMAIL",
      "data": "rick@astley.com",
      "description": "He rickrolled me too many times.",
      "created_at": "2022-12-12T12:12:12.000000Z",
      "updated_at": "2022-12-12T12:12:12.000000Z",
      "store_id": 1
    }
  ],
  "links": {
    // ...
  },
  "meta": {
    // ...
  }
}

POST/v1/blacklists

Create a blacklist rule

This endpoint allows you to create a new blacklist rule. See the code examples for how to create a new blacklist rule with the SellApp API.

Required attributes

  • Name
    type
    Type
    string
    Description

    The type of blacklist rule. Supported types:

    • ASN
    • COUNTRY
    • EMAIL
    • IP
    • WILDCARD_EMAIL
  • Name
    data
    Type
    string
    Description

    The data related to the above type. Examples:

    • ASN: AS1234
    • COUNTRY: BE
    • EMAIL: rick@astley.com
    • IP: 1.3.3.7
    • WILDCARD_EMAIL: @yahoo.com
  • Name
    description
    Type
    string
    Description

    The description of why this blacklist rule was created.

Request

POST
/v1/blacklists
$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{
  "type": "WILDCARD_EMAIL",
  "data": "@yahoo.com",
  "description": "This email domain is dangerous"
}');

$request->setRequestUrl('https://sell.app/api/v1/blacklists');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders([
  'accept' => 'application/json',
  'content-type' => 'application/json',
  'Authorization' => 'Bearer {ApiKeyHere}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();

Response

{
  "id": 1,
  "type": "WILDCARD_EMAIL",
  "data": "@yahoo.com",
  "description": "This email domain is dangerous",
  "created_at": "2022-12-12T12:12:12.000000Z",
  "updated_at": "2022-12-12T12:12:12.000000Z",
  "store_id": 1
}

GET/v1/blacklists/:id

Retrieve a blacklist rule

This endpoint allows you to retrieve a specific blacklist rule by providing the unique identifier. Refer to the list at the top of this page to see which properties are included with blacklist rule objects.

Request

GET
/v1/blacklists/:id
$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://sell.app/api/v1/blacklists/1');
$request->setRequestMethod('GET');
$request->setHeaders([
  'accept' => 'application/json',
  'Authorization' => 'Bearer {ApiKeyHere}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();

Response

{
  "id": 1,
  "type": "WILDCARD_EMAIL",
  "data": "@yahoo.com",
  "description": "This email domain is dangerous",
  "created_at": "2022-12-12T12:12:12.000000Z",
  "updated_at": "2022-12-12T12:12:12.000000Z",
  "store_id": 1
}

PATCH/v1/blacklists/:id

Update a blacklist rule

This endpoint allows you to perform an update on a blacklist rule.

Optional attributes

  • Name
    type
    Type
    string
    Description

    The type of blacklist rule. Supported types:

    • ASN
    • COUNTRY
    • EMAIL
    • IP
    • WILDCARD_EMAIL
  • Name
    data
    Type
    string
    Description

    The data related to the above type. Examples:

    • ASN: AS1234
    • COUNTRY: BE
    • EMAIL: rick@astley.com
    • IP: 1.3.3.7
    • WILDCARD_EMAIL: @yahoo.com
  • Name
    description
    Type
    string
    Description

    The description of why this blacklist rule was created.

Request

PATCH
/v1/blacklists/:id
$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{
  "type": "WILDCARD_EMAIL",
  "data": "@yahoomail.com",
  "description": "This email domain is super dangerous"
}');

$request->setRequestUrl('https://sell.app/api/v1/blacklists/1');
$request->setRequestMethod('PATCH');
$request->setBody($body);

$request->setHeaders([
  'accept' => 'application/json',
  'content-type' => 'application/json',
  'Authorization' => 'Bearer {ApiKeyHere}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();

Response

{
  "id": 1,
  "type": "WILDCARD_EMAIL",
  "data": "@yahoomail.com",
  "description": "This email domain is super dangerous",
  "created_at": "2022-12-12T12:12:12.000000Z",
  "updated_at": "2022-12-12T12:12:12.000000Z",
  "store_id": 1
}

DELETE/v1/blacklists/:id

Delete a blacklist rule

This endpoint allows you to delete a blacklist rule.

Request

DELETE
/v1/blacklists/:id
$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://sell.app/api/v1/blacklists/1');
$request->setRequestMethod('DELETE');
$request->setHeaders([
  'accept' => 'application/json',
  'Authorization' => 'Bearer {ApiKeyHere}'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();