On-ramp API

This guide provides detailed instructions for integrating a payment processing API. It includes essential endpoints for creating accounts, initiating payments, managing payment results, and integrating with the @checkout.com SDK.

Understanding the type Parameter

The type parameter is a key component of the payment process. It specifies the method of payment handling and impacts the behavior of API endpoints and required request fields.

Possible Values for type

  • PLATFORM: Payments are handled internally within the system. Requires the accountId parameter to specify the internal account for payment processing.

  • CHECKOUT: Payments are processed through an external checkout interface, redirecting users to a payment gateway or external interface.

πŸ“˜

SDK Integration: @checkout.com/checkout-web-components

  • EXTERNAL: Payments are managed by external third-party systems or services. Additional fields, such as someData, may be required to provide integration details.

Note: If accountType is not specified, it defaults to CHECKING.

Proper implementation of the type parameter ensures seamless integration and correct processing for the intended payment method.


Integration Steps

1. Create an Account with Type CHECKING

Endpoint: Create Account
This endpoint allows you to create an account with the following parameters:

  • type: Set to CHECKING.
  • currency: Specify the desired currency.
  • blockchain: Include the blockchain type.

2. Initiate a PayIn Operation

Endpoint: Create PayIn
Use this endpoint to deposit funds into your account.

Parameters:

  • Query Params:

    • dryRun (boolean): Simulates the operation without execution, returning expected details like rates and fees.
  • Body Params:

    • account (string): Identifier of the target account.
    • fromCurrency (string): Currency from which the amount will be converted.
    • toCurrency (string): Currency to which the amount will be converted.
    • fromAmount (string): Amount in the fromCurrency for conversion.

Response:
After successful execution, you'll receive an invoiceId required for creating an invoice payment.


3. SDK Integration for CHECKOUT

Installation Guide:
Use the @checkout.com/checkout-web-components SDK to integrate an external payment interface.

Installation Example via npm:

npm install @checkout.com/checkout-web-components

Usage Example:

// Insert your public key here
const publicKey = '{your_public_key}';

// Initialise a new Checkout Web Components instance
const checkout = await loadCheckoutWebComponents({
  paymentSession,
  publicKey,
  environment: 'sandbox'
});

// You can now create and mount a Flow component using 'checkout'
const flowComponent = checkout.create('flow');

// Mount Flow component to div element with an ID of 'flow-container'
flowComponent.mount('#flow-container');

4. Create an Invoice Payment with Type CHECKOUT

Endpoint: Create Invoice Payment
Use this endpoint to create an invoice payment using the CHECKOUT type.

Steps:

  1. Use the invoiceId obtained from the previous step.
  2. Input the required details into the external checkout interface provided by the SDK.

Response:
You'll receive the payment data necessary for further processing within the checkout system.


By following these steps and utilizing the provided endpoints, you can successfully integrate payment processing functionalities into your system.