Skip to main content
POST
/
api
/
v2
/
payment-method
Create payment method
curl --request POST \
  --url https://demo.api.loopcrypto.xyz/api/v2/payment-method \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "My Crypto Wallet",
  "merchantId": "89a4b012-c3d4-45e6-f789-012345678901",
  "customerId": "89a4b012-c3d4-45e6-f789-012345678901",
  "networkId": 1,
  "walletAddress": "0x2593DFBD86F2A0e51500869D3b027C6e5Ee48365",
  "tokenAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "tokenSymbol": "USDC",
  "isDefault": true,
  "authorizationSignature": "eyJzaWduYXR1cmUiOiIweDhjZTkyNjA4MWMyNGZhN2M1ZXJhODQ2ZGI5NWMzNDU1ODllNTBmMDMwYmJmRWhkYWQzMWY3N2Zja2YwNGxMNDgyMzVmMjUyYmYxOGFhYWMxMzIwNzNkNzZjNmM5NDI4ZjBjZDk1YmYwZDY1MGFmOTRkZDNhNmRlNDAxMWZmOWRlMWIiLCJib2R5IjoibG9vcGNyeXB0by54eXogd2FudHMgeW91IHRvIHNpZ24gaW4gd2l0aCB5b3VyIEV0aGVyZXVtIGFjY291bnQuXG5cbkkgYWNjZXB0IExvb3AgQ3J5cHRvIEluYydzIFRlcm1zIG9mIFNlcnZpY2VcblxuVVJJOiBodHRwOi8vbG9jYWxob3N0OjUxNzMvXG5XZWIzIFRva2VuIFZlcnNpb246IDJcbkNoYWluIElEOiAxMTE1NTExMVxuSXNzdWVkIEF0OiAyMDI1LTAxLTE0VDAyOjE5OjI5LjQ2NlpcbkV4cGlyYXRpb24gVGltZTogMjAyNS0wMS0xNVQw="
}'
{
  "paymentMethodId": "1234567890abcdef",
  "merchantId": "67e55044-10b1-426f-9247-bb680e5fe0c8",
  "paymentMethodName": "My Crypto Wallet",
  "active": true,
  "customer": {
    "customerId": "1234567890abcdef",
    "customerRefId": "1234567890abcdef"
  },
  "networkId": 1,
  "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
name
string
required

A descriptive name to identify this payment method

Example:

"My Crypto Wallet"

merchantId
string
required

The ID of the merchant to associate this payment method with.

Example:

"89a4b012-c3d4-45e6-f789-012345678901"

customerId
string
required

The ID of the customer to associate this payment method with.

Note: This is not the customerRefId from the customer object, it is the customerId

Example:

"89a4b012-c3d4-45e6-f789-012345678901"

networkId
integer
required

The blockchain network ID the payout destination is associated with.

Valid values:

  • 1 (Ethereum)
  • 10 (Optimism)
  • 56 (BNB)
  • 137 (Polygon)
  • 8453 (Base)
  • 42220 (Celo)
  • 42161 (Arbitrum)
  • 900 (Solana)
  • 11155111 (Sepolia) - Only available on the demo environment
  • 901 (Solana Devnet) - Only available on the demo environment
Required range: x >= 1
Example:

1

walletAddress
string
required

The blockchain wallet address where payments will be sent from. Must be a valid address for the specified network.

Example:

"0x2593DFBD86F2A0e51500869D3b027C6e5Ee48365"

authorizationSignature
string
required

A base64 encoded JWT token containing a signature proving ownership of the wallet address being registered as a payment method.

Example:

"eyJzaWduYXR1cmUiOiIweDhjZTkyNjA4MWMyNGZhN2M1ZXJhODQ2ZGI5NWMzNDU1ODllNTBmMDMwYmJmRWhkYWQzMWY3N2Zja2YwNGxMNDgyMzVmMjUyYmYxOGFhYWMxMzIwNzNkNzZjNmM5NDI4ZjBjZDk1YmYwZDY1MGFmOTRkZDNhNmRlNDAxMWZmOWRlMWIiLCJib2R5IjoibG9vcGNyeXB0by54eXogd2FudHMgeW91IHRvIHNpZ24gaW4gd2l0aCB5b3VyIEV0aGVyZXVtIGFjY291bnQuXG5cbkkgYWNjZXB0IExvb3AgQ3J5cHRvIEluYydzIFRlcm1zIG9mIFNlcnZpY2VcblxuVVJJOiBodHRwOi8vbG9jYWxob3N0OjUxNzMvXG5XZWIzIFRva2VuIFZlcnNpb246IDJcbkNoYWluIElEOiAxMTE1NTExMVxuSXNzdWVkIEF0OiAyMDI1LTAxLTE0VDAyOjE5OjI5LjQ2NlpcbkV4cGlyYXRpb24gVGltZTogMjAyNS0wMS0xNVQw="

tokenAddress
string

The token contract address for the payment type. Must be a valid token contract address for the specified network. Either 'tokenAddress' or 'tokenSymbol' must be provided.

Example:

"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"

tokenSymbol
string

The token symbol that identifies the token on the blockchain network. Must match the symbol of the token contract. Either 'tokenAddress' or 'tokenSymbol' must be provided.

Example:

"USDC"

isDefault
boolean

Whether the payment method is the default payment method for wallet address. Defaults to true.

Example:

true

Response

Ok

paymentMethodId
string
required

The unique identifier for the payment method

Example:

"1234567890abcdef"

merchantId
string
required

The unique identifier of the merchant this payment method is associated with

Example:

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

paymentMethodName
string
required

The name of the payment method

Example:

"My Crypto Wallet"

active
boolean
required

Whether the payment method is active or not. Inactive payment methods cannot be used for payins

Example:

true

customer
object
required

The customers that are associated with the payment method

networkId
number
required

The blockchain network ID the payment method is associated with

Example:

1

walletAddress
string
required

The blockchain wallet address where payments will be sent from

Example:

"0x1234567890abcdef"

isDefault
boolean
required

Whether the payment method is the default payment method for wallet address

Example:

true

token
object
required

The token associated with the payment method

preAuthorization
object
required

The status of the payment method, including the wallet's balance and authorization status

dateCreated
number
required

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

Example:

1716211200

I