Skip to main content

How to fund a Customer address via ONRAMP

Overview​

ONRAMP allows customers to pay in fiat and receive cryptocurrency to a customer purse address.

Use this guide when you already use Customers and want to fund a customer's crypto address through ONRAMP API or ONRAMP Widget.

Prerequisites​

RequirementDescription
Customer existsCreate a customer before starting the ONRAMP flow.
Customer address existsGet a customer purse address for each currency that can be funded through ONRAMP.
Webhooks are configuredSubscribe to customer purse transaction webhooks and ONRAMP payment webhooks.
Currency is supportedMake sure the target currency is available for the customer purse address and ONRAMP flow.

Integration flow​

  1. Create a customer by using [POST] customer-purse/customer/create
  2. Get the customer's deposit address by using [POST] customer-purse/address/get
  3. Create an ONRAMP payment or initialize the ONRAMP widget. Pass the customer purse address as the destination external address.
  4. Customer completes fiat payment through the ONRAMP flow.
  5. Receive customer purse webhooks when crypto is credited to the customer address.
  6. Confirm customer transaction details by using [POST] customer-purse/transaction/get

Sequence​

Names of requests on the scheme indicate Customer Purse API methods, ONRAMP flow, and customer purse webhooks.

Customer ONRAMP sequence

Implementation notes​

StepDetails
Save customer IDThe customer ID links the user in your system to Calypso customer purse operations.
Save purse addressThe purse address is passed to ONRAMP as the crypto destination address.
Use ONRAMP API or WidgetChoose API integration for server-side flow or Widget for embedded customer payment flow.
Track final deposit statusCustomer purse transaction webhooks confirm whether the crypto deposit was received or declined.

Expected customer purse webhooks​

EventMeaning
CUSTOMER_PURSE_PENDING_COMPLIANCEThe resulting crypto transaction is under compliance check.
CUSTOMER_PURSE_COMPLIANCE_DECLINEDThe resulting crypto transaction failed compliance check.
CUSTOMER_PURSE_FUNDS_RECEIVED_FOR_PURSEThe resulting crypto transaction was received by the customer purse.
CUSTOMER_PURSE_TRANSLATION_TO_ACCOUNT_COMPLETEDFunds were credited to the merchant account.
DocumentLink
Create customerHow to create a Customer
Get customer deposit addressHow to get a deposit address for a customer
Process customer transactionsHow to process Customer transactions
ONRAMP API integrationHow to create a payment via ONRAMP
ONRAMP Widget integrationHow to integrate the ONRAMP widget