curl --request POST \
--url https://prod01.oms.fabric.inc/api/v2/configurations/fraud-config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-site-context: <x-site-context>' \
--data '{
"serviceName": "FRAUD_RELEASE_SERVICE",
"processName": "ORDER_CREATE",
"configuration": {
"conditions": "[ // OR BLOCK START\n [ // AND BLOCK STARTS\n {\n \"key\": \"orderDate\",\n \"operator\": \"lte\",\n \"type\": \"date\",\n \"value\": [-59, \"SECONDS\"] // now -59 sec\n },\n {\n \"key\": \"type\",\n \"operator\": \"in\",\n \"value\": [\"web\", \"mobile\"]\n }\n ], // AND BLOCK END\n [ // AND BLOCK STARTS\n {\n \"key\": \"orderDate\",\n \"operator\": \"lt\",\n \"type\": \"date\",\n \"value\": [-10, \"MINUTES\"]\n },\n {\n \"key\": \"type\",\n \"operator\": \"is\",\n \"value\": \"postman\"\n }\n ] // AND BLOCK ENDS\n ] // OR BLOCK ENDS\n"
}
}'
{
"tenantId": "asferf3r4safasdcd",
"serviceName": "FRAUD_RELEASE_SERVICE",
"processName": "ORDER_CREATE",
"configuration": {
"conditions": "[ // OR BLOCK START\n [ // AND BLOCK STARTS\n {\n \"key\": \"orderDate\",\n \"operator\": \"lte\",\n \"type\": \"date\",\n \"value\": [-59, \"SECONDS\"] // now -59 sec\n },\n {\n \"key\": \"type\",\n \"operator\": \"in\",\n \"value\": [\"web\", \"mobile\"]\n }\n ], // AND BLOCK END\n [ // AND BLOCK STARTS\n {\n \"key\": \"orderDate\",\n \"operator\": \"lt\",\n \"type\": \"date\",\n \"value\": [-10, \"MINUTES\"]\n },\n {\n \"key\": \"type\",\n \"operator\": \"is\",\n \"value\": \"postman\"\n }\n ] // AND BLOCK ENDS\n ] // OR BLOCK ENDS\n"
}
}
Create Fraud configuration for the given tenantId
curl --request POST \
--url https://prod01.oms.fabric.inc/api/v2/configurations/fraud-config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-site-context: <x-site-context>' \
--data '{
"serviceName": "FRAUD_RELEASE_SERVICE",
"processName": "ORDER_CREATE",
"configuration": {
"conditions": "[ // OR BLOCK START\n [ // AND BLOCK STARTS\n {\n \"key\": \"orderDate\",\n \"operator\": \"lte\",\n \"type\": \"date\",\n \"value\": [-59, \"SECONDS\"] // now -59 sec\n },\n {\n \"key\": \"type\",\n \"operator\": \"in\",\n \"value\": [\"web\", \"mobile\"]\n }\n ], // AND BLOCK END\n [ // AND BLOCK STARTS\n {\n \"key\": \"orderDate\",\n \"operator\": \"lt\",\n \"type\": \"date\",\n \"value\": [-10, \"MINUTES\"]\n },\n {\n \"key\": \"type\",\n \"operator\": \"is\",\n \"value\": \"postman\"\n }\n ] // AND BLOCK ENDS\n ] // OR BLOCK ENDS\n"
}
}'
{
"tenantId": "asferf3r4safasdcd",
"serviceName": "FRAUD_RELEASE_SERVICE",
"processName": "ORDER_CREATE",
"configuration": {
"conditions": "[ // OR BLOCK START\n [ // AND BLOCK STARTS\n {\n \"key\": \"orderDate\",\n \"operator\": \"lte\",\n \"type\": \"date\",\n \"value\": [-59, \"SECONDS\"] // now -59 sec\n },\n {\n \"key\": \"type\",\n \"operator\": \"in\",\n \"value\": [\"web\", \"mobile\"]\n }\n ], // AND BLOCK END\n [ // AND BLOCK STARTS\n {\n \"key\": \"orderDate\",\n \"operator\": \"lt\",\n \"type\": \"date\",\n \"value\": [-10, \"MINUTES\"]\n },\n {\n \"key\": \"type\",\n \"operator\": \"is\",\n \"value\": \"postman\"\n }\n ] // AND BLOCK ENDS\n ] // OR BLOCK ENDS\n"
}
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
The x-site-context
header is a JSON object that contains information about the source you wish to pull from. The mandatory account
is the 24 character identifier found in Copilot. The channel
(Sales channel ID), stage
(environment name), and date
attributes can be used to further narrow the scope of your data source.
"{\"date\": \"2023-01-01T00:00:00.000Z\", \"channel\": 12, \"account\": \"1234abcd5678efgh9ijklmno\",\"stage\":\"production\"}"
Fraud Configuration Request model
Configuration updated.
Fraud Configuration Response model
Was this page helpful?