Ban an End User
curl --request POST \
--url https://sandbox-b2b.ripio.com/api/v1/end-users/{end_user_id}/ban/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "Violated terms & conditions"
}
'import requests
url = "https://sandbox-b2b.ripio.com/api/v1/end-users/{end_user_id}/ban/"
payload = { "reason": "Violated terms & conditions" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'Violated terms & conditions'})
};
fetch('https://sandbox-b2b.ripio.com/api/v1/end-users/{end_user_id}/ban/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-b2b.ripio.com/api/v1/end-users/{end_user_id}/ban/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reason' => 'Violated terms & conditions'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-b2b.ripio.com/api/v1/end-users/{end_user_id}/ban/"
payload := strings.NewReader("{\n \"reason\": \"Violated terms & conditions\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox-b2b.ripio.com/api/v1/end-users/{end_user_id}/ban/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"Violated terms & conditions\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-b2b.ripio.com/api/v1/end-users/{end_user_id}/ban/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"Violated terms & conditions\"\n}"
response = http.request(request)
puts response.read_body{
"end_user_id": "Customer_1",
"is_banned": true,
"reason": "Violating terms & conditions"
}End User Management
Ban an End User
Endpoint that bans an End User
POST
/
api
/
v1
/
end-users
/
{end_user_id}
/
ban
/
Ban an End User
curl --request POST \
--url https://sandbox-b2b.ripio.com/api/v1/end-users/{end_user_id}/ban/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "Violated terms & conditions"
}
'import requests
url = "https://sandbox-b2b.ripio.com/api/v1/end-users/{end_user_id}/ban/"
payload = { "reason": "Violated terms & conditions" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'Violated terms & conditions'})
};
fetch('https://sandbox-b2b.ripio.com/api/v1/end-users/{end_user_id}/ban/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-b2b.ripio.com/api/v1/end-users/{end_user_id}/ban/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reason' => 'Violated terms & conditions'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-b2b.ripio.com/api/v1/end-users/{end_user_id}/ban/"
payload := strings.NewReader("{\n \"reason\": \"Violated terms & conditions\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox-b2b.ripio.com/api/v1/end-users/{end_user_id}/ban/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"Violated terms & conditions\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-b2b.ripio.com/api/v1/end-users/{end_user_id}/ban/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"Violated terms & conditions\"\n}"
response = http.request(request)
puts response.read_body{
"end_user_id": "Customer_1",
"is_banned": true,
"reason": "Violating terms & conditions"
}After the ban operation is completed, the same information will be sent via the IPN Webhook.
Authorizations
B2B’s White Label API uses OAuth2. Currently there is only one supported authentication flow:
- clientCredentials allows you to access your own B2B account (First-Party Integration) and performs transactions against the public API. This oauth2 flow is well suited for this API, as it allows machine-to-machine communication.
Every call to the API has to be authenticated with an OAuth2 Token. In order to request this token, you will need to have sandbox or production API Keys (client id and client secret) that will be needed to generate a credential in order to negotiate an ephemeral access token.
Every request must be accompianed by an Authorization header with a value that follows the following schema: Bearer ACCESS_TOKEN
Path Parameters
Body
application/json
Reson for banning. Not mandatory.
Was this page helpful?