# Preparation for integration

1. After registration you need to go through the activation process through tech support and verify your account.
2. In the Shop Management section (https://dashboard.swcpay.com/Shop/Shop) you need to specify the URL where the Callback about the change of payment status will be received.

**Payment creation using Server-to-Server**

1. Send JSON request to one of the methods /api/v1/payment/, /api/v1/payment/fiat/, /api/v1/payment/recurrent, get payment data
2. Then you can display the received data on your site, or redirect the client to the payment form of swcpay, the link to the payment form will also be displayed in the response to requests

**Flow create payment using redirect**

1. Send a FormData request to one of the methods /api/v1/payment/pages/, /api/v1/payment/pages/fiat/, /api/v1/payment/pages/recurrent, by sending these requests your client should be redirected by the request URL.
2. If the request is successful, your client should end up on a swcpay payment form with the currency and amount you specified.

**Flow Callback**

1. Create a payment using any of the above methods, pay the invoiced amount or wait for the payment window to end.
2. The swcpay platform will send you a request with the data of this payment when the payment status changes to any of the supported ones in the system.
3. Make sure that this request was actually sent by the swcpay platform by checking the Signature field, you should also check that the payment has the value false in the Test field.
4. If all checks are correct, swcpay expects to receive an HTTP 200 OK response, if the response was received with a different status swcpay will continue to try to send the Callback until it is correctly received or the number of attempts to send it reaches 30.
5. If the Callback could not be received in 30 attempts, you should fix the problem that prevented it from being processed correctly and contact technical support so that we can check the sending of the Callback again.

**API key generation** To generate an API key, go to “Store Connection” -> “” Store Management” tab in your personal cabinet.
