API Documentation
English
English
  • Authorization
  • Request signing
  • List of error codes
  • Webhooks
  • IFrame order
  • Payment acceptance widget
  • Telegram MiniApp
  • API Reference
    • Base actions
      • Check x-api-signature
      • Fetch available currencies
      • Current price request
      • Search for operations by TX hash
      • Check address format
      • Get transaction history
    • Advanced account
      • Get advanced balances of user
      • Get advanced balance by id
      • Get payment address for advanced balance top-up
    • Blockchain addresses
      • Search by id
      • Transactions tracking
      • Search by address
      • Meta-data
      • Address Transactions
      • Last transaction of the address
      • Getting a list of PayIn addresses
      • Getting a list of business addresses
      • Get recurrent addresses
      • Getting a list of PayOut addresses
      • Creating a new business wallet address
      • Creating a new PayOut wallet address
    • Personal addresses
      • User creation
      • Getting an address
      • Getting a list of addresses
      • Get user
      • Adding a trusted address
      • Getting a list of trusted addresses
      • Deleting a trusted address
    • Orders
      • Creating an order
      • Getting information about an order
      • Getting a list of orders
    • Withdraws
      • Getting a commission for making a withdrawal
      • Sync withdraw
      • Async withdrawal
      • Receiving withdrawal information
    • Invoices
      • Create an invoice for payment
      • Invoice information request
      • Getting a list of invoices
    • Auto swaps
      • Create auto-swap
      • Find auto-swap by ID
    • Withdrawals 2.0
      • Create auto-withdrawal
      • Find auto-withdrawal by ID
      • Additional confirmation of the withdrawal
    • Bridge
      • Getting limits for cross-chain transfer
      • Getting information about cross-chain transfer
      • Commission token formation
      • Creating a cross-chain translation
    • Swaps
      • Getting limits for cross-chain exchange
      • Getting information about cross-chain exchange
      • Commission token formation
      • Creation of a cross-chain exchange
    • Recurring payments
      • Creating a payment link
      • Get a payment link
      • Get payment links by user
      • Disabling the payment link
      • Create a subscription
      • Getting a subscription
      • Cancel Subscription
      • Creating a payment
    • KYT
      • Check transaction risks
      • Check withdrawal risks
      • Check withdrawal risks for provided address
    • Partners API
      • Create user
      • Get user
      • Get all users
      • Creating an organization
      • Getting a list of organizations
      • Getting the user's advance balances
      • Replenishment of the user's advance balance
      • Get general tariffs
      • Create/update individual tariff
      • Get individual tariffs
      • Create API key
      • Get API keys
      • Delete API key
    • Webhooks
      • Get webhook
      • Get webhook (extended)
    • Orphan transactions
      • Get a transaction
      • Get a list of transactions
      • Get a commission token
      • Withdrawal
    • Address book
      • Add an address
      • Delete an address
      • Update the address
      • Get a list of addresses
Powered by GitBook
On this page
  1. API Reference
  2. Partners API

Create/update individual tariff

The method allows you to create or update an individual tariff.

If a tariff already exists for this userId and action, then the rest of the specified data will overwrite this tariff

Request:

The response contains an array of tariff objects:

Parameter

Type

Description

userId

String

User ID

action

String

Tariff action

amount

String

The commission percentage of the transaction amount (for example, 0.01 means a commission of 1% of the transaction amount)

minAmount

String or null

The minimum commission for charging (for example, when performing an operation, 1% of the transaction amount will be charged, but not less than minAmount) null - without limits

maxAmount

String or null

The maximum commission for charging (for example, when performing an operation, 1% of the transaction amount will be charged, but no more than maxAmount) null - without limits

comment

String or null

Comment/note for tariff

Parameter action can take the following values:

Tariff

Description

INTERNAL_TRANSFER

Internal transfer

ORDER_DEPOSIT

Accepting payments for order

WALLET_DEPOSIT

Deposit to wallet

WALLET_WITHDRAWAL

Withdrawal from wallet

PAYOUT_DEPOSIT

Deposit to payout balance

PAYOUT_WITHDRAWAL

Withdrawal from payout balance

PERSONAL_DEPOSIT

Deposit to personal address

PERSONAL_WITHDRAWAL

Withdrawal from personal address

COLLECT_WITHDRAWAL

Withdrawal from collect address

RECURRENT_DEPOSIT

Deposit to recurrent address (by periodical subscription)

RECURRENT_WITHDRAWAL

Withdrawal from recurrent address

BRIDGE_INTERNAL

Blockchain bridge (change network)

BRIDGE_EXTERNAL

Blockchain bridge via API

EXCHANGE_INTERNAL

Exchange

EXCHANGE_AUTO

Exchange via API

PreviousGet general tariffsNextGet individual tariffs

Last updated 7 months ago

  • Request:
  • POSTCreate/update individual tariff

Create/update individual tariff

post
Header parameters
x-api-public-keystringOptional

Public API-key

x-api-signaturestringOptional

Signing the request body with a private API-key

Content-typestringOptional

Request content type

Example: application/json
Body

The body of the request to create an individual tariff

userIdstringOptional

User ID

Example: 09c89009-2dcb-415e-a0dc-907d407426ac
organizationIdstringOptional

Organization ID

Example: bd3864af-8284-4338-8b76-07532a0679d6
actionstring · enumOptional

Target action on the tariff

Example: EXCHANGE_AUTOPossible values:
amountstringOptional

The commission percentage of the transaction amount (for example, 0.01 means a commission of 1% of the transaction amount)

Example: 0.03
typestring · enumOptional

Type of fare amount

Example: PERCENTPossible values:
commentstring | nullOptional

Tariff Comment

Example: tariff for John
minAmountstring | nullOptional

Minimum commission for debiting (for example, when performing an operation, 1% of the transaction amount will be debited, but not less than MinAmount)

null - no restrictions

Example: 0.1
maxAmountstring | nullOptional

The maximum commission for debiting (for example, when performing an operation, 1% of the transaction amount will be debited, but no more than MaxAmount)

null - no restrictions

Example: 3000
Responses
200Success
application/json
post
POST /partner/api/set-organization-tariff HTTP/1.1
Host: ocp.onchainpay.io
Content-Type: application/json
Accept: */*
Content-Length: 228

{
  "userId": "09c89009-2dcb-415e-a0dc-907d407426ac",
  "organizationId": "bd3864af-8284-4338-8b76-07532a0679d6",
  "action": "EXCHANGE_AUTO",
  "amount": "0.03",
  "type": "PERCENT",
  "comment": "tariff for John",
  "minAmount": "0.1",
  "maxAmount": "3000"
}
200Success
{
  "success": true,
  "response": null
}