NoFraud API Quickstart Guide
This guide aims accomplish two things:
- Generate your first API key
- Create your first transaction
After that, you'll be ready to begin building your NoFraud integration.
Get Your API Key
All Custom/Direct API integrations require an API key. This can be generated in the NoFraud Portal through the Integrations page. Follow the steps below to generate your API key.
Navigate to the Integrations page via the sidebar menu
Click the "Create New Integration" button
Select "Custom/Direct Api"
Choose "Fraud Protection"
Complete the form
Choose either "Test" or "Live" depending on whether you're creating an API key for a test or production integration.
Note that test credit cards will not be accepted with Live API keys. Similarly, real credit cards will not be accepted with Test API keys.
Copy your API key
Keep it safe and get ready to use it in the next section.
Create Your First Transaction
The core functionality of any custom NoFraud integration is creating transactions for review.
A transaction can include a vast amount of data about a purchase event including credit card details, addresses, line items, pricing, discounts, and more. For the sake of this quickstart guide, we'll stick to the bare minimum.
In the example below, we're creating a test transaction using the "4111111111111111" test credit card along with some fake customer details. We'll send this to the test API endpoint https://apitest.nofraud.com/
.
Remember to add your test API key before running any of the samples below.
curl --location 'https://apitest.nofraud.com/' \ --header 'Content-Type: application/json' \ --data-raw '{ "nfToken": "YOUR_KEY_HERE", "customer": { "email": "example@email.com" }, "billTo": { "firstName": "John", "lastName": "Smith", "address": "123 Broadway Apt #1", "city": "New York", "state": "NY", "zip": "11001", "country": "US", "phoneNumber": "1112223333" }, "customerIP": "127.0.0.1", "amount": "50", "avsResultCode": "U", "cvvResultCode": "1", "payment": { "creditCard": { "last4": "9999" } } }'
Assuming all went well, you should get a 200 response code and the newly created transaction id
and decision
.
{ "id": "3317d310-1b4f-4d98-bd7d-44121ded2158", "decision": "pass" }
Next steps
With an API key and the ability to create transactions, you're ready to start building a real integration.
Check out Workflows for the different ways you can integrate with NoFraud.
Or jump right into API Reference if you already know what you need.