For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
RegisterLoginSandbox Login
GuidesRecipesAPI Reference
GuidesRecipesAPI Reference
  • Getting Started
    • Getting Started with Checkout
    • ACH Checkout
    • Card Checkout with Credits
    • Card Checkout
    • Direct USDC Settlement
    • Fiat/Crypto Pay-ins
    • Secure Marketplace Checkout
    • EVM Checkout
    • How to Enable Checkout with Credit Cards
    • Quick Start Marketplace Implementation
    • Payouts
    • Common FAQs
  • Checkout
    • Settlement Locations
        • About Chargeback Protection
        • How Chargeback Protection Works
        • Implement Chargeback Protection
        • Improving Chargeback Protection Acceptance Rates
        • Overriding Chargeback Protection
        • Sending Payer Events
        • Chargeback Reason Codes
        • Fraud Alerts and Chargeback Notifications
        • Responding to Disputes
        • AVS
      • PCI Compliance
    • Checkout Webhooks
  • Payouts
    • Payout Overview
    • What is a Payout
  • Subscriptions
    • Subscriptions Overview
  • Marketplaces
    • Marketplace Overview
    • How Marketplaces Work
    • How to Withdraw USDC
    • Countries Eligible for USDC Withdraw
    • Marketplaces Webhooks
    • Marketplaces Implementation
  • Developer Resources
    • Custom Branding
    • Checkout Implementation
    • Webhooks
  • Merchant Dashboard
    • Login & Account Access
    • Users and Roles
    • Rate Limits
    • Developer Contact
LogoLogo
RegisterLoginSandbox Login
On this page
  • Overview
  • How to Add Chargeback Protection
  • Implement the nSure Mobile SDK
  • IOS:
  • Android:
  • Additional Steps:
  • SDK Repositories:
  • Application ID: 9JBW2RHC7JNJN8ZQ
  • What to pass into chargebackProtectionData
  • Example of chargebackProtectionData data structure
  • Example Implementation on Coinflow’s Prebuilt UI
  • Example Implementation on Coinflow’s APIs
CheckoutPayment Security & Risk ManagementFraud Protection

How To: Implement Chargeback Protection

Developers can use this documentation to implement chargeback protection for all card checkouts.
Was this page helpful?
Previous

Improving Chargeback Protection Acceptance Rates

Next
Built with

Overview

Coinflow provides multiple ways to protect merchant accounts against fraud. Learn more about fraud prevention methods before you start implementing chargeback protection.

How to Add Chargeback Protection

When merchants opt-in for chargeback protection, they will need to add our chargeback protection provider’s sdk across every page of their site. This integration enables our provider to gather extra data during the customer’s shopping experience. Depending on your implementation method, select from the below options to view instructions on how to implement:

Sample React Native Diff Files: Android | iOS

React
  1. Add the <CoinflowPurchaseProtection> component to every page on your site.
  2. Add your merchantId as a property to the <CoinflowPurchaseProtection> component.
  3. In every <CoinflowPurchase> component, add the chargebackProtectionData property and input information about each purchase made via Coinflow.
React Native

Implement the nSure Mobile SDK

IOS:

  1. Drag and drop LocalPods folder from ReactNative > Resources into local IOS folder. Add this line to the podfile “pod ‘nSure’, :path => ‘LocalPods/nSure’” and run pod install
  2. Drag and drop NSureSDK.h and NSureSDK.m from ReactNative > Resources into the Xcode workspace. In NSureSDK.h change the conditional import to just “#import <React/RCTBridgeModule.h>”
  3. Add dependency AdSupport in the Xcode General tab under Frameworks, Libraries and Embedded Content
  4. In the Xcode Build Settings tab add -framework “nSure” to the Other Linker Flags. Follow the remaining steps in the docs as is.
  5. Call nsureSDK.sharedInstanceWithAppID to get the deviceId

Android:

  1. Create a ‘libs’ folder in the android app and drag and drop Nsure.aar into the folder. Drag and drop NSureSDK.java and NSureSDKPackage.java into the project source (android > app > src > main > java > com > ‘project name’ >)
  2. Change the first line in NSureSDK.java and NSureSDKPackage.java from “package com.nsurereactnativesample;” to “package com.<project name>”. Follow the remaining steps in the docs as is.
  3. Call nsureSDK.getDeviceId to get the deviceId

Additional Steps:

  1. Pass the deviceId in {"<CoinflowPurchase>"} by implementing the following code:
1import { NativeModules } from 'react-native';
2var nsure = NativeModules.NSureSDK;
3var deviceId = "";
4nsureSDK.sharedInstanceWithAppID("9JBW2RHC7JNJN8ZQ", (nsure, _deviceId) => {
5 this.deviceId = _deviceId;
6});
  1. In {"<CoinflowPurchase>"} add the chargebackProtectionData property and add information about every purchase that is being made via Coinflow.

SDK Repositories:

Here are the links for the public repositories of the iOS and Android SDKs:

  • iOS SDK Repository
  • Android SDK Repository

Application ID: 9JBW2RHC7JNJN8ZQ

API
  1. Add the following code to every page on your site:
1{"<script src=\"https://sdk.nsureapi.com/sdk.js\"> </script>"}
2<script>
3 window.nSureAsyncInit = function(deviceId) {
4 window.nSureSDK.init('9JBW2RHC7JNJN8ZQ');
5 window.nSureSDK.init({
6 appId: '9JBW2RHC7JNJN8ZQ', // Remains the same on sandbox and prod
7 partnerId: 'COINFTEST' //Use COINFTEST on sandbox. This will be assigned on PROD
8 });
9 };
10</script>

📘 This code will allow us to gather information on the user’s device, how they interact with your website, and other info that allows the models to predict the risk of fraud or chargeback for this particular user.

  1. To each of your API calls, add the x-device-id header and pass the value which comes as a result of calling window?.nSureSDK?.getDeviceId() on your website.

This deviceId is how the system relates the individual request to the information collected about the user’s device and session from the SDK added above.

  1. In the Checkout Endpoint and the Redeem Transaction Endpoint, pass the chargebackProtectionData.

📘 This information provides information about what is being purchased, which allows the AI models to determine the risk of chargeback for this particular purchase.

What to pass into chargebackProtectionData

Merchants that opt-in for chargeback protection are required to pass chargebackProtectionData as a prop to the <CoinflowPurchase> component or to our card checkout, saved card checkout, ach checkout , and redeem transaction endpoints.

🚧 The more information that you pass here the better the authorization rates will be, so it is in your best interest to supply as much information as possible

Example of chargebackProtectionData data structure

1{
2 /**
3 * The name of the product
4 */
5 productName: string;
6 /**
7 * The product type. Possible values include: inGameProduct, gameOfSkill, dataStorage, computingResources, sportsTicket, eSportsTicket, musicTicket, conferenceTicket, virtualSportsTicket, virtualESportsTicket, virtualMusicTicket, virtualConferenceTicket, alcohol, DLC, subscription, fundACause, realEstate, computingContract, digitalArt, topUp
8 * Contact Coinflow for the productType value.
9 */
10 productType: 'inGameProduct' |
11 'gameOfSkill' |
12 'dataStorage' |
13 'computingResources' |
14 'sportsTicket' |
15 'eSportsTicket' |
16 'musicTicket' |
17 'conferenceTicket' |
18 'virtualSportsTicket' |
19 'virtualESportsTicket' |
20 'virtualMusicTicket' |
21 'virtualConferenceTicket' |
22 'alcohol' |
23 'DLC' |
24 'subscription' |
25 'fundACause' |
26 'realEstate' |
27 'computingContract' |
28 'digitalArt' |
29 'topUp';
30 /**
31 * The number of units sold
32 */
33 quantity: number;
34 /**
35 * Any additional data that the store can provide on the product, e.g. description, link to image, etc.
36 */
37 rawProductData?: { [key: string]: any };
38}

Example Implementation on Coinflow’s Prebuilt UI

1<CoinflowPurchase
2 wallet={wallet}
3 merchantId={process.env.REACT_APP_MERCHANT_ID as string}
4 transaction={transaction}
5 amount={amount}
6 blockchain={'solana'}
7 chargebackProtectionData={[{
8 "productName": "Sword", // Name of Product
9 "productType": "inGameProduct", // Get the value from Coinflow
10 "quantity": 1,
11 "rawProductData": { // Adjust based on the available product data
12 "productID": "sword12345",
13 "productDescription": "A legendary sword with magical powers.",
14 "productCategory": "Weapon",
15 "weight": "15 lbs",
16 "dimensions": "40 in x 5 in",
17 "origin": "Ancient Kingdom",
18 "craftedBy": "Master Blacksmith",
19 "craftingDate": "2024-06-19"
20 }
21 },]}
22/>

Example Implementation on Coinflow’s APIs

1curl --request POST \
2 --url https://api-sandbox.coinflow.cash/api/checkout/ach/merchantId \
3 --header 'accept: application/json' \
4 --header 'content-type: application/json' \
5 --data '
6{
7 "subtotal": {
8 "cents": 100
9 },
10 "transactionData": {
11 "type": "safeMint"
12 },
13 "token": "5a000000-0000-0000-0000-000000000000",
14 "chargebackProtectionData": [
15 {
16 "productType": "inGameProduct",
17 "productName": "Sword",
18 "quantity": 1,
19 "rawProductData": {
20 "productID": "sword12345",
21 "productDescription": "A legendary sword with magical powers.",
22 "productCategory": "Weapon",
23 "weight": "15 lbs",
24 "dimensions": "40 in x 5 in",
25 "origin": "Ancient Kingdom",
26 "craftedBy": "Master Blacksmith",
27 "craftingDate": "2024-06-19"
28 }
29 }
30 ]
31}
32'