POST
/
anti-fraud-services
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.{gr4vy_id}.gr4vy.app/anti-fraud-services"

	payload := strings.NewReader("{\n  \"anti_fraud_service_definition_id\": \"sift-anti-fraud\",\n  \"display_name\": \"Sift Anti-Fraud Service.\",\n  \"fields\": [\n    {\n      \"key\": \"api_key\",\n      \"value\": \"sk_test_26PHem9AhJZvU623DfE1x4sd\"\n    },\n    {\n      \"key\": \"account_id\",\n      \"value\": \"26PHem9AhJZvU623DfE1x4sd\"\n    }\n  ]\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, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
{
  "type": "anti-fraud-service",
  "id": "fe26475d-ec3e-4884-9553-f7356683f7f9",
  "merchant_account_id": "default",
  "anti_fraud_service_definition_id": "sift-anti-fraud",
  "display_name": "Sift Anti-Fraud Service.",
  "active": true,
  "reviews_enabled": false,
  "fields": [
    {
      "key": "approve_decision",
      "value": "sk_test_26PHem9AhJZvU623DfE1x4sd"
    }
  ],
  "created_at": "2013-07-16T19:23:00.000+00:00",
  "updated_at": "2013-07-16T19:23:00.000+00:00"
}

This endpoint requires the anti-fraud-services.write scope.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

A request to create an anti-fraud service. A request to update an anti-fraud service.

Response

201
application/json

Returns the anti-fraud service that was added.

The response is of type object.