Deposit creation

Interaction scheme

  1. Your server requests a transaction, receives the transaction ID and unique payment link for the user.

  2. The user is redirected to a unique payment link where they receive requisites for the transfer. At this point, you are not required to do anything.

  3. Our system processes the user’s transaction and sends a webhook (callback) about successful payment notification to your server. In case when payment is unsuccessful the notification is not sent.

Backend integration

Send an API request to get a unique payment link for the user.

Request

POST https://repay.cx/api/v1/private/deals/

Headers

Name
Type
Description

Content-Type

application/json

The data format sent in the request body. In this case it is JSON (application/json)

These fields can be passed as headers in the HTTP request depending on the API implementation.

Parameters

None

Body

Name
Type
Description
Required

cassa_id

string

Cashier's ID. Available in the merchant’s personal account

amount

string (number)

Transaction amount in fiat currency without cents

currency

string

Transaction fiat currency. Only currency supported by your cashier can be used RUB

payment_method_id

string

Payment method. Provided by support during integration

order_id

string

Internal transaction ID that will be sent to you in the webhook request

success_url

string

Link to redirect the user upon successful payment (can only be passed within the cashier's domain name)

error_url

string

Link to redirect the user in case of failed payment (can only be passed within the cashier's domain name)

cancel_url

string

Link to redirect the user if they cancel the transaction (can only be passed within the cashier's domain name)

webhook_url

string

Webhook. Used to specify the callback address for sending notifications and can be enabled by request

signature

string

Signature to verify the authenticity of the request. It is generated in md5 from the string md (cassa_id:amount:secret_word_1)

payload

object

Additional information about transaction

payload.user_id

string

Unique user ID or their hash

payload.trusted

bool

Function of dividing traffic into primary and secondary traffic. Shows whether the user is trusted.

Always include payload.user_id(string) and payload.trusted(bool) for valid anti-fraud processing.

The settings from the cashiers will be used if the parameterscancel_url, success_url, error_url are not specified.

cURL Example

#!/bin/bash

cassa_id="836a9869-0598-4b75-81bc-f7a600b83a72" # Cashier ID
secret="9c41b016-c8c6-4f30-b3de-c1fb9c9ec01d" # Secret word 1
amount=300 # Only integers
signature=$(echo -n "$cassa_id:$amount:$secret" | md5sum | awk '{print $1}')

curl -X POST https://repay.cx/api/v1/private/deals/ \
-H "Content-Type: application/json" \
-d '{
  "cassa_id": "$cassa_id",
  "amount": "$amount",
  "currency": "RUB",
  "order_id": "string",
  "payment_method_id": "aeba4e28-4d1e-4cfb-84b6-cdf0672c29f1",
  "success_url": "https://domain.com/success_page",
  "error_url": "https://domain.com/error_page",
  "cancel_url": "https://domain.com/cancel_page",
  "payload": {
    "user_id": "Your user ID",
    "trusted": "false/true"
  },
  "signature": "$signature"
}'

This script calculates the signature using md5 first, and then sends a POST request using cURL.

Response

In response you get a payload with the information sent and a unique payment link.

Example of a successful response

{
   "status_code": 200,
   "error":
       {},
   "payload":
       {
           "id": "7a2ab81c-b041-4638-be6e-437049e7a8eb",
           "state": "created",
           "success_url": "https://example.com/success_page",
           "error_url": "https://example.com/error_page",
           "cancel_url": "https://example.com/cancel_page",
           "webhook_url": "https://example.com/api/repay_webhook",
           "payment_url": "https://paysystem3d.ac/355a7feb-c53b-4307-bfbc-43fc8da70948",
       }
}
Name
Type
Description

status_code

int

HTTP response status code. In this case 200 means success

error

object

Field to store error information. In the current example it is empty because there are no errors

payload

object

Basic payload of the transaction data response

payload.id

string

Unique transaction identifier (UUID)

payload.state

string

Current status of the transaction. In this case it is 'created'

payload.success_url

string

Link to the page for successful completion of the transaction

payload.error_url

string

Link to the transaction error page

payload.cancel_url

string

Link to the transaction cancellation page

payload.webhook_url

string

URL to send a webhook notifying about the status of the transaction

payload.payment_url

string

Payment link to the specific transaction

Example of an unsuccessful response

You will receive a response if there is an error in the creation of the cashier.

{
 "code": 610,
 "error": "Too small money amount",
 "description": "You can not create deal with amount less then 100"
}

Possible errors

Code
Name
Description

400

Bad request

Incorrect request

404

Not found exception

Could not find the required information in the database (for example, to find a cashier)

451

Unavailable for legal status

Created transaction has incorrect status

610

Too small money amount

Unable to create a deal for the sum less than the minimum amount for creating a transaction

611

Bad signature

Signature has been generated incorrectly

612

Unsupported payment method

Payment method is not supported

613

Unsupported currency

Currency is not supported

Last updated