Skip to main content

Create an Account

This API endpoint is used to create an account for the user. The request should include the user's internal ID in your system. Upon successful creation, the Processing Service will return the Exchange account ID.

Endpoint

POST https://<api hostname>/v1/payments/init

Request Headers

Authorization: Bearer <access_token>

Request Body

{
"address": { /* customer billing address */ },
"customer": { /* customer personal data */ },
"client_quote_id":"here_your_unique_id",
"crypto_code":"USDC",
"fiat_amount":"30.49",
"fiat_code":"EUR",
"merchant_redirect_url":"<redirect_url>",
"payment_method":"<payment_method>"
}

OpenAPI Spec

https://docs.lunupay.com/public-v1#tag/customers/post/payments/init

Example Request

POST https://api.exchange.lunupay.com/v1/payments/init

Authorization: Bearer l.QtEo8ahkNFX4RTpbqp0u4z4GDZq27HzUp6AotJASBx7_DVqmqZMHfM2Cy7JmUjS80boI9eVg

{
"address":{
"city":"Warsaw",
"address_line1":"Struga 11",
"country_code":"PL",
"postal_code":"11-123"
},
"customer":{
"dob":"1991-01-01",
"email":"somecustomeremail@gmail.com",
"external_id":"1c03ce26-5afd-18f9-951c-110117da26fb",
"first_name":"John",
"last_name":"Smith",
"ip_address":"11.111.111.11",
"phone_number":"+11231231212"
},
"client_quote_id":"fafasfwregtkdcovksd",
"crypto_code":"USDC",
"fiat_amount":"30.49",
"fiat_code":"EUR",
"merchant_redirect_url":"https://app.websiteexample.com/payment/fafasfwregtkdcovksd",
"payment_method":"card"
}

Example response

{
"customer_id": "123e4567-e89b-12d3-a456-426614174000",
"quote_id": "123e4567-e89b-12d3-a456-426614174000",
"redirect_url": null
}