# How to integrate

This chapter provides the instruction of the integration with the solution and with it's methods. Prior to using this solution is you have to proceed [onboarding](https://developer.verestro.com/books/paytool/page/onboarding) process and you require created account in the Verestro Paytool system.

<p class="callout info">**Note:** To create an account in the Verestro Paytool system please contact with support.</p>

<details id="bkmrk-verestro-paytool-api"><summary>Environment Test API base URL</summary>

```
https://paytool-api.verestro.dev
```

</details><details id="bkmrk-verestro-paytool-api-0"><summary>Environment Production API base URL</summary>

```
https://paytool-api.verestro.com
```

</details><p class="callout success">**Tip:** Below are presented sequence diagrams describing both ways of using the Paytool solution. We recommend using **Redirect you payer** integration path.</p>

<details id="bkmrk-integration-method-c"><summary>Integration method consisting in redirecting the payer to Paytool web view</summary>

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor payer  
participant "Customer front" as cfront  
participant "Customer backend" as cback  
participant "Paytool front" as pfront  
participant "Paytool backend" as pback  
payer-&gt;cfront: Pay with Paytool  
cfront-&gt;cback: Payer choosed Paytool  
cback-&gt;pback: Customer authorization + transaction metadata  
pback-&gt;pback: Store transaction metadata + open payment session  
cback&lt;-pback: OK + transaction id  
cfront&lt;-cback: OK + transaction id  
cfront-&gt;pfront: Redirect + transaction id  
pfront-&gt;pback: Get transaction data + merchant payment methods  
pfront&lt;-pback: OK response  
payer&lt;-pfront: Display transaction + payment methods  
@enduml

</details><details id="bkmrk-integration-method-c-0"><summary>Integration method consisting in continuing process via API calls</summary>

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor payer  
participant "Customer front" as cfront  
participant "Customer backend" as cback  
participant "Paytool backend" as pback  
payer-&gt;cfront: Pay with Paytool  
cfront-&gt;cback: Payer choosed Paytool  
cback-&gt;pback: Customer authorization + transaction metadata  
pback-&gt;pback: Store transaction metadata + open payment session  
cback&lt;-pback: OK + transaction id  
note right of cback: At this point, the Customer decides how to present the transaction to the payer  
cback-&gt;pback: Request proper payment method / executing 3D Secure  
cback&lt;-pback: Transaction result  
note right of cback: At this point, the Customer decides how to present the transaction result to the payer  
@enduml

</details>## [Methods in API](https://developer.verestro.com/books/paytool/page/paytool-external-api)

Our solution provides API method allowing you to order and process transaction by [creating payment session](https://developer.verestro.com/books/paytool/page/paytool-external-api) and send transaction metadata to our system. In order to opening new payment session you receive `transactionId` in response which is unique identifier of the created session. Every ordered transaction has his own payment session. Using `transactionId` you can whether redirect your payer to our Paytool web view or continue the transaction process using other API methods provided by our solution. This section describes all API methods in Paytool solution.

<p class="callout success">**Tip:** Below there is a description of every single Paytool API method. To see example request bodies please visit complete API documentation is [available here](https://developer.verestro.com/books/paytool/page/paytool-external-api) in SwaggerUI format. Please visit to see our methods.</p>

<p class="callout success">**Tip:** Detailed information about what is included in the transaction metadata is shown in the `<a href="https://developer.verestro.com/books/paytool/page/paytool-external-api">transactionInitialization</a>` method.</p>

[Opening Paytool in iframe](https://paytool.verestro.com/docs/)

This section describes the steps you need to take if you want the Paytool form to be displayed as an iframe on your website instead of redirecting your payer to Verestro Paytool website.

<p class="callout success">**Tip:** This section applies to customers who use the Redirect your payer implementation model. If you use a different integration model with Paytool, you can ignore this chapter.</p>