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/v4/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 first name. If the user has a middle name, include it in the firstName field (e.g., Mehmet Ali).

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.

swiftCode

string

Required for paymentMethod values such as BankTransfer or CryptoCurrency. Represents the SWIFT code of the destination account (if applicable).

address

string

Account number, IBAN, or wallet address.

Response

{
    "id": 1301436,
    "username": "Sheila_Daugherty",
    "firstName": "Mervin",
    "lastName": "MacGyver",
    "amount": 100,
    "currency": "TRY",
    "reference": "9caadedf-d18d-4e35-b98e-a495ca00f9be",
    "paymentMethod": 2,
    "swiftCode": "FNNBTRIS",
    "address": "TR290011100000000000000000",
    "timestamp": 1753708015391,
    "uniqueKey": "a475cbbbb3dc49069d66cf984e63f8b7"
}

Instructions

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

  2. Get the relevant swift code from swift code list.

    • If the selected paymentMethod is BankTransfer, providing a swiftCode is optional. The system can derive the relevant bank information directly from the provided IBAN.

    • If the selected paymentMethod is CryptoCurrency, swiftCode is mandatory.

    • For all other payment methods, swiftCode is not required.

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

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

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

Retrieve Swift Code Information

get

Retrieve the available swift codes.

Path parameters
paymentmethodstringRequired
Header parameters
x-api-keystringRequired

The API key for authentication.

Responses
200

A JSON array of available swift codes.

application/json
get
GET /api/v4/paymentmethod/swiftcode/{paymentmethod} HTTP/1.1
Host: testlink.paylayercore.com
x-api-key: text
Accept: */*
[
  {
    "name": "text",
    "swiftCode": "text"
  }
]

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 · double · min: 0.01Required
currencystring · min: 1Required
referencestring | nullableOptional
paymentMethodinteger · int32Required

Enum - PaymentMethod

swiftCodestringOptional

Optional due to IBAN-based withdrawal

addressstring · min: 1Required
Responses
200

Withdrawal successful.

application/json
post
POST /api/v4/paymentmethod/withdrawal HTTP/1.1
Host: testlink.paylayercore.com
x-api-key: text
Content-Type: application/json
Accept: */*
Content-Length: 158

{
  "username": "text",
  "firstName": "text",
  "lastName": "text",
  "amount": 1,
  "currency": "text",
  "reference": "text",
  "paymentMethod": 1,
  "swiftCode": "text",
  "address": "text"
}
{
  "id": 1,
  "username": "text",
  "firstName": "text",
  "lastName": "text",
  "amount": 1,
  "currency": "text",
  "reference": "text",
  "paymentMethod": 1,
  "swiftCode": "text",
  "address": "text",
  "timestamp": 1,
  "uniqueKey": "text"
}

Last updated