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
. 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"
]
}
}
Retrieve the 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"
}