Pre-select a virtual currency for incoming payments
Overview
This guide provides step-by-step instructions for receiving payments by pre-selecting a virtual currency.
1. Create a Payment Intent
Use the Create a PaymentIntent endpoint and send a payload with at least the required parameters.
In the successful response, you will receive the Payment Intent ID, and the URL to the Payment Window to which you will redirect your customer after the next step.
You will need the Payment Intent ID in the next step.
BTC is the cryptocurrency preselected on the Payment Window by default if no other quote is created before redirecting the end-user to the Payment Window.
2. Create a quote in the desired cryptocurrency
Use the Create Quote endpoint to create a quote in the specific cryptocurrency you want to be preselected on the Payment Window.
Notice that you need to provide the ID of the Payment Intent you have previously created in the API request Path.
Specify the cryptocurrency you want preselected in the currency
parameter, provide the refundAddress
, and supply the refundTag
if necessary.
Important
All virtual currencies apart from BTC, require the refundAddress to be provided.
In case the field is missing, the API returns an error.
For this scenario, it is required from your customer to provide a refund address to you. You (your system) then forwards the provided address to Coinify API. In case the address belongs to the merchant, the merchant is responsible for refunding the customer back.
In the successful response, you will receive the full Payment Intent object payload, where under the quotes
array the new quote you just created will be listed.
3. Redirect your customer
Redirect your customer to the paymentWindowUrl
that you have received in the initial API response of the Create Payment Intent request from the first step.
Your customer will land on the Payment Window with the quoted cryptocurrency preselected.
The supported virtual currencies are different for each PaymentIntent and they depend on its amount.
Note
Use the
GET
HTTP verb to redirect your customer.
Expect a notification
Coinify sends a notification to the provided URL when the PaymentIntent has been completed.
For more information, read the Webhooks guide.
Validate the signature
Coinify includes a signature in the form of a header in the sent request.
For more information, read the Webhooks guide.
Important
Never accept a payload before validating that the signature is correct.
The amount has been credited
Once you have received a notification that contains the correct signature, you can serve your customer.
The payment was successful and the amount has been credited to your account.
Updated 9 months ago