Skip to content

API Endpoints

All requests require authentication headers. See Authentication for details.

Base URL: https://papi.cryptumpay.com

Response Format

All responses use the same envelope structure:

typescript
// Success
{ "data": T, "errorObject": null }

// Error
{ "data": null, "errorObject": { "httpCode": number, "appCode": number, "message"?: string } }

POST /v1/orders

Creates a new merchant order. Depending on your integration approach, the returned order ID can be:

  • Passed to the widget so the customer completes payment inline on your site
  • Used to form a payment gateway link — https://pay.cryptumpay.com/m/{orderId} — and sent to the customer via email, messenger, SMS, or any other channel (see Without Widget)

Request Body

FieldTypeRequiredDescription
titlestringYesOrder title shown to the customer
descriptionstringYesOrder description shown to the customer
fiatAmountstringYesPayment amount as a decimal string, e.g. "9.99"
fiatCurrencystringYesFiat currency code, e.g. "usd" or "eur"
urlstringNoReturn URL for the payment gate (overrides project-level successPath/failPath)
projectDataUserIdstringNoYour internal user ID to attach to the order
projectDataUserEmailstringNoCustomer email to attach to the order
projectDataOrderIdstringNoYour internal order ID to attach to the order
projectDataMetastringNoArbitrary metadata string (e.g. JSON) to attach to the order

Response

json
{
  "data": {
    "id": "1c885afe-369f-4b38-92fa-983660c2452d",
    "project": {
      "id": "string",
      "feePercent": 1.5,
      "logoUrl": "https://...",
      "title": "My Store",
      "url": "https://mystore.com"
    },
    "expiresAt": 1745975440234,
    "customerOrderRequest": {
      "fiatTicker": "usd",
      "fiatAmount": "9.99",
      "title": "Order #1",
      "description": "My product",
      "url": null,
      "projectData": {}
    }
  },
  "errorObject": null
}

Errors

appCodeDescription
6000Order creation failed (service unavailable or invalid parameters)

Node.js SDK

typescript
const response = await client.createOrder({
  title: 'Order #12345',
  description: 'Shopping cart checkout',
  fiatAmount: '49.99',
  fiatCurrency: 'usd',
  projectDataUserId: 'user_42',
  projectDataOrderId: 'internal-order-123',
});

if (response.errorObject) {
  console.error('Failed to create order:', response.errorObject);
} else {
  const orderId = response.data.id;
  // Pass orderId to the widget via onCreateOrder callback
}

GET /v1/orders/:orderId

Returns the current state of a merchant order, including whether a customer has started payment (customerOrderId).

Path Parameters

ParameterDescription
orderIdThe merchant order ID returned by POST /v1/orders

Response

json
{
  "data": {
    "id": "1c885afe-369f-4b38-92fa-983660c2452d",
    "project": { ... },
    "expiresAt": 1745975440234,
    "customerOrderRequest": { ... },
    "customerOrderId": "4fc1ae7b-c7f9-4dc7-2222-8d37f993e28f",
    "financeSummary": {
      "status": 3,
      "accrued": true,
      "income": {
        "amount": "49.10",
        "currency": "usd"
      }
    }
  },
  "errorObject": null
}

financeSummary is present only after the customer order reaches a final state. income reflects the amount actually credited after fees.

financeSummary Statuses

statusDescription
0In progress — customer order is being processed
1Under review — order is pending manual review
2Canceled — order was canceled
3Paid — payment received and funds credited
4Crediting — funds are being credited to your balance

The accrued field is true once funds have been credited to your project balance.

Confirming a successful payment

To confirm that funds were received, check that financeSummary.status is 3 or 4:

  • Status 3 (Paid) — funds have already been credited to your project balance.
  • Status 4 (Crediting) — crediting is still in progress, but the system has definitely received the payment and will complete the transfer shortly.

Do not fulfill orders based on status 0 (In progress) or 1 (Under review), as those states are not yet final.

Errors

appCodeDescription
6001Order not found or does not belong to your project

Node.js SDK

typescript
const response = await client.getOrder('1c885afe-369f-4b38-92fa-983660c2452d');

if (response.errorObject) {
  console.error('Order not found:', response.errorObject);
} else {
  console.log('Customer order ID:', response.data.customerOrderId);
  console.log('Finance summary:', response.data.financeSummary);
}

POST /v1/withdraw

IP Whitelist Required

This endpoint checks the IP address of the request. You must configure an IP whitelist for your API key in the console. Requests from unlisted IPs will be rejected with error 8002. See Authentication → IP Whitelist.

Initiates a cryptocurrency withdrawal to an external address.

Request Body

FieldTypeRequiredDescription
currencystringYesCryptocurrency ticker, e.g. "usdt"
blockchainstringYesBlockchain identifier, e.g. "bsc", "tron"
addressstringYesDestination wallet address
amountstringYesAmount to withdraw as a decimal string, e.g. "100.00"
extrastring | nullNoMemo/tag for blockchains that require it (e.g. XRP, TON)

Response

json
{
  "data": {
    "id": "b44ac754-b67a-4d79-8c78-61e01b9c1196"
  },
  "errorObject": null
}

Errors

appCodeDescription
8000Withdrawal creation failed (insufficient balance, invalid address, or service unavailable)
8002IP whitelist not configured for this API key
7003Request IP is not in the whitelist

Node.js SDK

typescript
const response = await client.withdraw({
  currency: 'usdt',
  blockchain: 'bsc',
  address: '0xYOUR_WALLET_ADDRESS',
  amount: '100.00',
});

if (response.errorObject) {
  console.error('Withdrawal failed:', response.errorObject);
} else {
  console.log('Withdrawal ID:', response.data.id);
}

GET /v1/withdraw/:id

IP Whitelist Required

Same requirement as POST /v1/withdraw — IP whitelist must be configured. See Authentication → IP Whitelist.

Returns the current status of a withdrawal.

Path Parameters

ParameterDescription
idThe withdrawal ID returned by POST /v1/withdraw

Response

json
{
  "data": {
    "status": "finished",
    "hash": "0xabc123..."
  },
  "errorObject": null
}

hash is the on-chain transaction hash, available once the transaction is broadcast.

Withdrawal Statuses

StatusDescription
createdWithdrawal queued, not yet processed
pendingTransaction submitted to the blockchain
finishedTransaction confirmed on-chain
failedWithdrawal could not be completed

Errors

appCodeDescription
8001Withdrawal not found or does not belong to your project

See Also

Released under the MIT License.