How To: Implement Marketplace Credits (API)
Summary
Merchants can follow this guide to learn how to implement a Credits purchase flow on Coinflow’s Marketplace so that end-users can purchase credits, then spend those credits towards purchases with sellers. Upon spending credits, Sellers will receive their funds in their seller wallet and can then withdraw their earnings from profits.
Setup
- Register a marketplace account on sandbox
🚧 Please reach out to the Coinflow team with your merchant id once you’ve completed this so we can configure your account for marketplaces!
Resources
- Demo of marketplaces
- Read about how 3DS works.
- Read about how to override chargeback protection decisions.
- Read about how credit card payments work .
- Read about credit card authorization, capture, and void.
- Read about what countries Coinflow supports withdrawing directly to banks to.
- Sellers who reside in countries that are not supported by Coinflow’s direct bank offramps, can offramp in USDC. Read more about what countries can offramp in USDC and learn how you can direct sellers to withdraw their USDC.
Getting Started
1.Create a seller registration link
- This will generate a link which sellers can use to register themselves as a seller under the marketplace.
2.Get a seller login link
- This will generate a link which sellers can use to login to their seller dashboard to view purchases, customers, withdraw their funds, view withdraw history.
3.Generate a wallet for the payer
In order to purchase credits, payers need to have a wallet, which will act as a place that will house the credits. Given the payer’s email, calling this endpoint will generate a wallet address on behalf of the payer.
4. Allow the payer to purchase credits
This endpoint will generate a purchase link. Marketplaces can collect their own fees for each credit purchase if they’d like. The fixedFee or percentageFee will be taken from the subtotal and be immediately sent to your marketplace’s wallet balance when the payer purchases the credits. In the example below, the marketplace will receive 50 in credits.

5. Get the Payer’s credit balance
Payers can use either credits or Solana USDC to pay creators directly. You can get the balance a payer has in their wallet by calling the Get Checkout Balances Endpoint.
6. Allowing payers to spend their credits/USDC
- Request JWT Token
This tokenizes the checkout request parameters.RequestResponse - Generate a tokenized checkout link so end-user can spend their credits.
- Add link to an iframe
Generate Iframe



7. Listen to webhook events for:
- seller registration related webhook events
- checkout related webhook events
- subscription related webhooks events
8. Add Chargeback protection on every page of your site!!
- Note: It is a requirement to add this script to the head of every page, and not just where the payment occurs. After filling in the chargeback protection questionnaire, Coinflow will provider a partner id.

