Skip to main content

Create a Payment [POST]

Requirements

ℹ️ Before launching a payment, you need to have a Merchant created, as each payment will be related to a Merchant (merchant_id).

Create a Payment

Create a payment request by sending simply the amount to charge, the description (optional) and the payment_type (Bank or Crypto). For now, Sylq only supports EUR or GBP for bank payments. If you would like to use Sylq with other currencies please get in touch.

Endpoints

Staging environment

  • Staging URL: https://staging.sylq.io/api/v1/payments

Production/Live environment

  • Production/Live URL: https://app.sylq.io/api/v1/payments

Schema

{
"amount": 0,
"description": "string",
"payment_type": "bank",
"merchant_id": 0,
"metadata": {},
"callback_url_ok": "string",
"callback_url_notok": "string"
}

Example of request

{
"amount": 10,
"description": "Payment for something",
"payment_type": "bank",
"merchant_id": 25,
"metadata": {MYREFERENCE},
"callback_url_ok": "https://example.com/my_url_ok",
"callback_url_notok": "https://example.com/my_url_notok"
}

Examples of returns

Success response (201)

{
"reference": "V9FWKSAAW0",
"description": "Payment for something",
"amount": 100.5,
"paid_amount": 0,
"fee_amount": -1.005,
"currency": "EUR",
"status": "pending",
"type": "bank",
"checkout_url": "http://app.sylq.io/payment/V9FWKSAAW0/checkout",
"created_at": "2022-12-01T12:40:31.279Z",
"merchant_id": 1,
"payer_name": null,
"qr_image": "http://app.sylq.io/payment/V9FWKSAAW0/qr",
"metadata": {
"internal_reference": "MYREFERENCE"
},
"underpaid_amount": null,
"exchange_rate": null,
"underpaid": "100.5"
}

Error response (422)

{
"errors": {
"description": [
"is required"
],
"payment_type": [
"is required"
],
"merchant_id": [
"is required"
]
}
}

Retrieves a Payment [GET]

Endpoints

Staging environment

  • Staging URL: https://staging.sylq.io/api/v1/payments/{reference}

Production/Live environment

  • Production/Live URL: https://app.sylq.io/api/v1/payments/{reference}

Examples of returns

Success response (201)

{
"reference": "21N8SZZGZH",
"description": "Aut magni amet sint.",
"amount": 47.64,
"paid_amount": 47.64,
"fee_amount": -0.4764,
"currency": "EUR",
"status": "confirmed",
"type": "bank",
"checkout_url": "http://app.sylq.io/payment/21N8SZZGZH/checkout",
"created_at": "2022-12-01T12:40:33.059Z",
"merchant_id": 1,
"payer_name": null,
"qr_image": "http://app.sylq.io/payment/21N8SZZGZH/qr",
"metadata": {
"internal_reference": "AIIXSYNLV5"
},
"underpaid_amount": null,
"exchange_rate": null,
"underpaid": 0
}

Error response (422)

{
"errors": "Not found"
}

Validating a Bank Payment

You can validate the bank payment once the payment is launched, in the response among other values, you will see the checkout_url and the QR code in image format qr_image.

If you take the checkout_url and simulate that you are a payer, you will be able to find in the search box a few banks from France, Spain, the UK and neobanks (in Production we have much more).

Bank Payment example

For payments with Euros, you can use both the Spanish bank (Unicaja) and the Italian bank (Fineco), in Staging environments, not all banks allow you to launch simulated payments, and at the same time, in the Staging environment the payment experience will be through Browser, in the Production environment, the payment experience will be better.

Below, we detail three banks with their usernames/passwords so you can make a complete "simulated" payment:

Cumberland (UK and GBP)

  • username: 999999999998
  • password: Passw0rd

Fineco (IT and EUR)

  • username: Use any username and password
  • password: Use any username and password

Unicaja (ES and EUR)

  • Username: user1
  • Password: 1234
  • Security Key: 123456

Validating a Crypto Payment

You can validate the crypto payment once the payment is launched, in the response among other values, you will see the checkout_url and the QR code in image format qr_image.

For the Crypto case, the Staging environment is connected to Blockchains on Production environments, which is why you will be able to make real payments with BTC, ETH, USDT, etc... the minimum is €0.10.

Crypto Payment example

If you want to see an entire payment process with Crypto, here is an example.