Withdrawal

Initiating a Withdrawal via Payment Method API

To initiate a withdrawal for a user, a POST request must be sent to the following endpoint. The request body should be JSON formatted with the following parameters:

Create Withdrawal

POST /api/v1/paymentmethod/withdrawal

Headers

Name
Value

Content-Type

application/json

x-api-key

<x-api-key>

Body

Name
Type
Description

username

string

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

firstName

string

The user's given 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": 92,
    "username": "Cristal_Bogan93",
    "firstName": "Kyra",
    "lastName": "Halvorson",
    "amount": 100,
    "currency": "TRY",
    "reference": "fea12848-7c9e-4425-8133-8d81d8225e13",
    "paymentPageUrl": "https://testpayment.paylayercore.com/transaction/869356d1e973480680fe5206e9a25896"
}

Instructions

  1. Gather the necessary user details and the desired withdrawal amount.

  2. Create the JSON payload with the correct user and transaction details.

  3. Make the POST request to the designated endpoint with the JSON body.

  4. Upon receiving the response, direct the user to the paymentPageUrl to carry out the withdrawal operation.

Note: Validate the paymentPageUrl before redirecting the user to ensure its authenticity and security.

Withdrawal Request

post

Make a withdrawal 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
Withdrawal successful.
application/json
post
POST /api/v1/PaymentMethod/withdrawal 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