Deposit

Initiating a Deposit via Payment Method API

To initiate a deposit for a user, you need to send a POST request to the following endpoint. The request body must be in JSON format and include the following parameters:

Create Deposit

POST /api/v3/paymentmethod/deposit

Headers

NameValue

Content-Type

application/json

x-api-key

<x-api-key>

Body

NameTypeDescription

username

string

The user's unique username. It should be dynamically generated or retrieved from your user database.

firstName

string

The user's first name.

lastName

string

The user's last name.

amount

decimal

The deposit amount in the smallest currency unit (e.g., cents, pence).

currency

string

The currency of the deposit amount (e.g., TRY, USD, EUR, GBP).

reference

string

A unique identifier for the transaction, typically a UUID or your unique transaction Id.

paymentMethod

integer

The identifier number for the selected payment method.

Response

{
    "id": 89,
    "username": "Laisha87",
    "firstName": "Adaline",
    "lastName": "Kirlin",
    "amount": 100,
    "currency": "TRY",
    "reference": "b0d99e7e-0760-4865-8de7-899a8e11944d",
    "paymentPageUrl": "https://testpayment.paylayercore.com/transaction/1db85eebe3f2404cbed3cffb44b7caf6"
}

Instructions

  1. Collect the necessary user information and the deposit amount.

  2. Construct the JSON request payload with the appropriate values.

  3. Send the POST request with the payload to the provided endpoint.

  4. On receipt of the response, extract the paymentPageUrl and redirect the user to this URL to proceed with the payment.

Note: Always validate the paymentPageUrl before redirecting the user to ensure it is a valid and secure link.

If a user sends a new request before their previous request is completed, they will receive a "pending transaction" warning. To avoid this warning, save the paymentPageUrl information for the ongoing transaction. Keep this URL until the user completes their transaction. If the user tries to make another request before the first one is completed, instead of creating a new request, redirect them to the saved paymentPageUrl.

Last updated