API Documentation
To integrate FoxyPay into your website, simply follow these simple steps:

1. Obtain your store's API key. To do this, log in to your personal account and navigate to the "My Stores" section.
2. Add your store and undergo moderation.
3. After moderation, you will receive your API key in the store editing section.
4. Your store will operate in the currency you have selected. If your store's currency is EUR, invoices will be issued via the API in EUR.

Once you have obtained the key, you can make an API request to create a payment link.

Endpoint for creating a payment link: https://foxypay.net/api/payment

Fields:

amount - The amount, specified in cents. For example, if you want to create an invoice for $10, you should specify 10 * 100 = 1000.
description - Description of your invoice on the payment page.
webhook_url - Callback address to receive notifications of successful payment.
success_url - The address to return to your website in case of successful payment.
fail_url - The address to return to your website in case of unsuccessful payment.
info - A hidden block with data that comes with the webhook; you can pass your own data here.


PHP (curl) integration code example





Python (requests) integration code example





Successful Response



Status code: 200

status - true, successful response
redirect_url - link for redirection to the payment page


Unsuccessful Response



Status code: 422

status - false, unsuccessful response
err - field containing an error with an explanation of the cause


WebHook


Sent via POST request to your webhook_url that you specified when generating the payment link



Поля


  • 1. code - transaction code
  • 2. amount - amount (specified in kopecks)
  • 3. currency - currency
  • 4. info - your field that you provided when generating the payment link
  • 5. sign - request signature, HMAC SHA256


Check sign (PHP example)