# Trustap lite code example The following code sample is a possible implementation of the solution in PHP. In the sample, use the form to enter your Trustap API key and redirect URI configured during [setup](/docs/intro/auth). The sample creates a simple button. When a buyer presses the button you can redirect them to pay seller `sarah.garcia@gmail.com` for an item. ```mermaid %%{init: {"theme":"base", "themeVariables": { "primaryColor": "#ffffffff", "fontSize": "16px", "fontFamily": "mulish", "lineColor": "#ffffffff" }}}%% sequenceDiagram participant Buyer participant Marketplace participant Trustap Buyer->>Marketplace: Click "Buy Now" button Marketplace->>Trustap: Send seller & transaction details (API call) Trustap-->>Marketplace: Return actions_url Marketplace->>Buyer: Redirect to Trustap payment screen Buyer->>Trustap: Complete payment Trustap-->>Marketplace: Send webhook (payment confirmed) Trustap-->>Marketplace: Send webhook (optional - transaction cancelled) ``` Add your API credentials configured during your [Trustap setup](/docs/intro/auth). Your Trustap API key In this example, the credentials are hard coded. For production, this is a security risk. We recommend using environmental variables or using a secret manager. Add your `redirect_uri`. This was configured during your [Trustap setup](/docs/intro/auth). Your redirect_uri Configure your seller details including details about the product or service for sale. These are required fields. Add the appropriate API endpoint. * For testing, use `https://dev.stage.trustap.com/api/v1/p2p/listings/create_with_seller`. * For production, use `https://dev.trustap.com/api/v1/p2p/listings/create_with_seller`. Send the request to the Trustap API. Enable buyer to purchase item with button. The button click makes the API call to Trustap. Redirect your user to the Trustap payment screen to pay for the transaction.