Getting an address

By using this method you can:

  • Get the address for the user in the specified coin and network. When the request is repeated, the previously created address is returned, which will have isActive: true

  • Generate a new address for the user in the specified coin and network, when specifying the parameter renewAddress. The new address will have isActive: true, previously generated addresses with the same coin and network will have isActive: false

Note: At any time, a user can have only one active address in particular coin and network. Deposits and withdrawals work at all addresses, regardless of the parameter isActive

Getting an address

POSThttps://ocp.payonchain.org/api-gateway/personal-addresses/get-user-address
Header parameters
Body
id*string

User ID

currency*string

Address coin

network*string

Address network

renewAddressboolean

If set to true a new address will be issued to the user, the old one will become inactive

Response
Body
success*boolean

Request success indicator

response*PersonalAddressResponse (object)

Personal address response body

Request
const response = await fetch('https://ocp.payonchain.org/api-gateway/personal-addresses/get-user-address', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "id": "463fa3c3-bc26-451a-9eb9-5cb0d7d7c5aa",
      "currency": "USDT",
      "network": "ethereum"
    }),
});
const data = await response.json();
Response
{
  "success": false,
  "response": {
    "id": "3d9f93dd-9447-48ab-9f49-366588de96d8",
    "userId": "ecfc4f24-2de9-45f8-b939-dc8efb47f7c2",
    "currency": "USDT",
    "network": "ethereum",
    "address": "0x515b72ed8a97f42c568d6a143232775018f133c8",
    "balance": "1234.1234",
    "isActive": false
  }
}

Last updated