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/v1/paymentmethod/deposit

Headers

Name
Value

Content-Type

application/json

x-api-key

<x-api-key>

Body

Name
Type
Description

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.

Deposit Request

post

Make a deposit request.

Header parameters
x-api-keystringRequired

The API key for authentication.

Body
usernamestring · min: 1Required
firstNamestring · min: 1Required
lastNamestring · min: 1Required
amountnumber · decimal · min: 1Required
currencystring · min: 1Required
referencestring | nullableOptional
paymentMethodinteger · int32Required
Responses
200
Deposit successful.
application/json
post
POST /api/v1/PaymentMethod/deposit HTTP/1.1
Host: testlink.paylayercore.com
x-api-key: text
Content-Type: application/json
Accept: */*
Content-Length: 122

{
  "username": "text",
  "firstName": "text",
  "lastName": "text",
  "amount": 1,
  "currency": "text",
  "reference": "text",
  "paymentMethod": 1
}
{
  "id": 1,
  "username": "text",
  "firstName": "text",
  "lastName": "text",
  "amount": 1,
  "currency": "text",
  "reference": "text",
  "paymentPageUrl": "text"
}

Last updated