LogoLogo
  • GENERAL
    • About Criptan
    • Get started
      • Introduction
      • 1. Activate your account
      • 2. Add funds to your balance
      • 3. Start interacting with the API
    • API
      • Introduction
      • Authentication
        • Auth Transactions and Earn
          • API Reference
        • Auth Business (Criptan Pay)
      • Real-Time API (WebSockets)
        • OHLCV
        • TICKERS
      • Webhooks
        • Transactions and Earn Webhooks
        • Business Webhooks
      • API reference
      • Changelog
    • Developer tools
      • Sandbox
      • Support
      • Feedback
    • Security
  • Transactions
    • General
      • Overview
      • Available exchange
      • Geographic availability
      • Use cases
        • Buy
          • UX example
        • Sell
          • UX example
        • Send crypto
          • UX example
        • Receive crypto
          • UX example
        • Recurring purchases
          • UX example
        • Check history
      • FAQ
    • API Reference
      • Trades
      • Withdrawals
      • Information
  • Earn
    • General
      • Overview
      • Geographic availability
      • Use cases
        • 3, 6, 12 months
          • Make a deposit
            • UX example
          • Set up auto-renew a deposit automatically
            • UX example
        • Flex
          • Make a deposit
            • UX example
          • Make a withdrawal
            • UX example
          • Cancel a withdrawal
            • UX example
          • Set up reinvest or not rewards
            • UX example
        • Flex and 3, 6, 12 months
          • Receiving Rewards
      • FAQ
    • API Reference
  • Business (Criptan Pay)
    • General
      • Business (Criptan Pay)
      • Onboarding
      • Payment Button
      • Charges
      • FAQ
    • API Reference
      • Charge
      • Generate charge receipt
      • Get payment
    • Types CPay definitions
      • BusinessAccount
      • BusinessCharge
Powered by GitBook
On this page
  1. Business (Criptan Pay)
  2. General

Charges

PreviousPayment ButtonNextFAQ

Last updated 3 years ago

Charges represent a payment by your users, and have a wealth of data associated with it. Each charge has an associated checkout, which is a hosted page where a user can perform the payment. You'll need to redirect your users there so they can pay the charge. Note that charges (and it's associated checkouts) expire after a determined amount of time. Any payment done after the expiry of the charge will be refused.

NOTE

To understand the difference between PAID and CONFIRMED status later on, just bear in mind that a PAID orders mean that the payment was sent, while CONFIRMED means the payment is successful and the funds are in your account. If you are familiar with credit cards payment processing, they are the equivalent to AUTHORIZED and CAPTURED payments using credit cards.

Note that, contrary to usual fiat working, cryptocurrency payments can't be reversed. Once the funds hit your account, they are yours and can't be taken away.

Create charge

To request a cryptocurrency payment, you create a charge. Since cryptocurrency payments are push payments, a charge will expire after a waiting period (payment window) if no payment has been detected. Charges are identified by a unique code.

HTTP Request

TIP

Your metadata object has to be stringifable. If it is not, charge creation will fail.

Generate QR code

If you don't want to use the provided payment page, you can use the data received from charge creation to generate a QR code and address for payment. The procedure depends on each coin, but for BTC (the only accepted coin at this time) you can use the following with any QR code generator:

// Data is data received from creating a charge
const data = {
  address: '3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5',
  amount: '1'
}

const qrCode = bitcoin:${data.address}?amount=${data.amount}

You don't need to include sending fees: they are automatically included when the user scans the wallet, which allows the wallet to generate the fees dynamically.

WARNING

If you alter the amount field from the response when you generate the payment, the system will either register the charge as underpaid (if lowering the amount) or the amount overpaid (if making the amount bigger) will be lost!

Note that if you aren't careful, the amounts can cause rounding errors in certain programming languages.

https://app.gitbook.com/o/IqKLoXoEzDBbZy1LIFHy/s/RvqwWtIE7EFiyevKMP2T/criptan/business/charge