Skip to main content
POST
/
api
/
v2
/
customer
Create customer
curl --request POST \
  --url https://demo.api.loopcrypto.xyz/api/v2/customer \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "merchantId": "67e55044-10b1-426f-9247-bb680e5fe0c8",
  "customerRefId": "cus_1234abcd",
  "subscriptionRefId": "sub_1234abcd",
  "paymentMethod": {
    "networkId": 1,
    "walletAddress": "0x2593DFBD86F2A0e51500869D3b027C6e5Ee48365",
    "isDefault": true,
    "name": "My Crypto Wallet",
    "tokenAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
    "tokenSymbol": "USDC",
    "authorizationSignature": "eyJzaWduYXR1cmUiOiIweDhjZTkyNjA4MWMyNGZhN2M1ZXJhODQ2ZGI5NWMzNDU1ODllNTBmMDMwYmJmRWhkYWQzMWY3N2Zja2YwNGxMNDgyMzVmMjUyYmYxOGFhYWMxMzIwNzNkNzZjNmM5NDI4ZjBjZDk1YmYwZDY1MGFmOTRkZDNhNmRlNDAxMWZmOWRlMWIiLCJib2R5IjoibG9vcGNyeXB0by54eXogd2FudHMgeW91IHRvIHNpZ24gaW4gd2l0aCB5b3VyIEV0aGVyZXVtIGFjY291bnQuXG5cbkkgYWNjZXB0IExvb3AgQ3J5cHRvIEluYydzIFRlcm1zIG9mIFNlcnZpY2VcblxuVVJJOiBodHRwOi8vbG9jYWxob3N0OjUxNzMvXG5XZWIzIFRva2VuIFZlcnNpb246IDJcbkNoYWluIElEOiAxMTE1NTExMVxuSXNzdWVkIEF0OiAyMDI1LTAxLTE0VDAyOjE5OjI5LjQ2NlpcbkV4cGlyYXRpb24gVGltZTogMjAyNS0wMS0xNVQw="
  }
}'
{
  "customerId": "1234567890abcdef",
  "customerRefId": "1234567890abcdef",
  "paymentMethods": [
    {
      "networkId": 1,
      "merchantId": "67e55044-10b1-426f-9247-bb680e5fe0c8",
      "paymentMethodId": "1234567890abcdef",
      "paymentMethodName": "My Crypto Wallet",
      "active": true,
      "walletAddress": "0x1234567890abcdef",
      "isDefault": true,
      "token": {
        "symbol": "USDC",
        "tokenId": "123e4567-e89b-12d3-a456-426614174000",
        "address": "0x1234567890abcdef",
        "decimals": 6,
        "exchangeRates": [
          {
            "currency": "USD",
            "price": "10000",
            "provider": "CoinMarketCap",
            "timestamp": 1715731200
          }
        ]
      },
      "preAuthorization": {
        "balance": "100",
        "authorization": "49.9"
      }
    }
  ],
  "dateCreated": 1716211200
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
merchantId
string
required

The identifier of the merchant that this customer will be associated with. This merchant must already exist in the system.

Example:

"67e55044-10b1-426f-9247-bb680e5fe0c8"

customerRefId
string

(Optional) An external customer reference ID used to tie this customer to a customer in an external system.

Example:

"cus_1234abcd"

subscriptionRefId
string
deprecated
Example:

"sub_1234abcd"

paymentMethod
object

The details for a new payment method that will be linked to the created customer. Either provide this or paymentMethodId to use an existing payment method. If both are provided, the paymentMethodId takes precedence.

Response

Ok

customerId
string
required

The unique identifier that represents the customer

Example:

"1234567890abcdef"

customerRefId
string | null
required

The external customer reference ID used to tie this customer to a customer in an external system.

Example:

"1234567890abcdef"

paymentMethods
object[]
required

The payment methods configured for this customer to make payments with.

dateCreated
number
required

The date the customer record was created, represented as a Unix timestamp in seconds.

Example:

1716211200

I