Stablecoin-to-Stablecoin

๐Ÿ“˜

Funding methods

For an explainer on the difference between a payment with vs. without source account ID, visit the Payments page.

Stablecoin to Stablecoin with Source Account Id

When sending a payment with a source.accountId, we will automatically pull funds from this account to fund the payment (as long as the Account is a Virtual Account or an External Account that allows pulling).

๐Ÿ“˜

Sandbox

In sandbox, there are two ways to get testnet USDC in your Virtual Digital Asset Wallet:

  1. Use the official testnet faucet: https://faucet.circle.com/
  2. Cancel a payment (this will automatically refund the USDC wallet)

Request

curl --request POST \
  --url 'https://sandbox-api.walapay.io/v1/payments/<customerId>' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'X-Api-Key: fa15de08-f1af-4c41-a74b-2302b6785c13' \
  --header 'X-Idempotency-Key: ced13348-d16d-4310-aa07-b3264cb00bc4' \
  --data '{
  "source": {
    "currencyCode": "USDC",
    "amount": 100,
    "rail": "CRYPTO",
    "chain": "POLYGON",
    "accountId": "cm3zbgjxe000hr8cqmm3v384e"
  },
  "destination": {
    "currencyCode": "USDT",
    "rail": "CRYPTO",
    "accountId": "cm3zbgjxe000hr8cqmm3v384e"
  },
  "comment": "Test USDC to USDT payment",
  "memo": "FFC80602740",
  "paymentReason": "Testing crypto to crypto payment"
}'

Stablecoin to Stablecoin without Source Entity Account Id

When sending a payment without a source.accountId, the response will include the funding instructions for the customer to fund the payment. All payments of this type have a 5 minute window for the customer to send the funds.

Request

curl --request POST \
  --url 'https://sandbox-api.walapay.io/v1/payments/<customerId>' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'X-Api-Key: fa15de08-f1af-4c41-a74b-2302b6785c13' \
  --header 'X-Idempotency-Key: ced13348-d16d-4310-aa07-b3264cb00bc4' \
  --data '{
  "source": {
    "currencyCode": "USDC",
    "amount": 100,
    "rail": "CRYPTO",
    "chain": "POLYGON",
    "fromAddress": "0x388C818CA8B9251b393131C08a736A67ccB19297"
  },
  "destination": {
    "currencyCode": "EURC",
    "rail": "CRYPTO",
    "accountId": "cm3zbgjxe000hr8cqmm3v384e"
  },
  "comment": "Test USDC to EURC payment",
  "memo": "FFC80602740",
  "paymentReason": "Testing crypto to crypto payment"
}'

Response

Notice that the response here includes a fundingInstructions object with the details required to fund the payment.

{
    "id": "cm40pxvdo0005xnyhgkr54uvk",
    "createdAt": "2024-11-28T02:51:50.173Z",
    "updatedAt": "2024-11-28T02:51:50.173Z",
    "status": "AWAITING_FUNDS",
    "comment": "Test USDC to PHP payment",
    "paymentReason": "Testing fiat to crypto payment",
    "source": {
        "rail": "CRYPTO",
        "chain": "POLYGON",
        "fromAddress": "0x388C818CA8B9251b393131C08a736A67ccB19297",
        "currencyCode": "USDC"
    },
    "destination": {
        "rail": "CRYPTO",
        "currencyCode": "EURC",
        "accountId": "cm3zbgjxe000hr8cqmm3v384e"
    },
    "fundingInstructions": {
        "amount": 100,
        "currencyCode": "USDC",
        "rail": "CRYPTO",
        "fromAddress": "0x388C818CA8B9251b393131C08a736A67ccB19297",
        "toAddress": "0x12345678900987654321234567890",
        "chain": "Example Chain"
    }
}