# Skrape Standard

### Roadmap

1. On your server, use our create payment endpoint to submit payment details.
2. We'll return a link to a payment page.
3. Your customer will be redirected to this link to complete the payment.
4. After the transaction is completed, the customer will be redirected back to your website.

### API Payload

<table><thead><tr><th width="222">Key</th><th width="103">Type</th><th width="111">Required</th><th>Description</th></tr></thead><tbody><tr><td>api_key</td><td>string</td><td>Yes</td><td>API key provided by Skrape to identify the merchant.</td></tr><tr><td>amount</td><td>string</td><td>Yes</td><td>Amount to be paid</td></tr><tr><td>tx_ref</td><td>string</td><td>No</td><td>A unique reference number for the transaction.</td></tr><tr><td>token_name</td><td>string</td><td>Yes</td><td>The name of the token or currency to be used for the transaction.</td></tr><tr><td>customer</td><td>object</td><td>Yes</td><td>It holds the customer email, first name, last name</td></tr><tr><td>customer.email</td><td>string</td><td>Yes</td><td>The email of the customer.</td></tr><tr><td>customer.first_name</td><td>string</td><td>No</td><td>The first name of the customer.</td></tr><tr><td>customer.last_name</td><td>string</td><td>No</td><td>The last name of the customer.</td></tr><tr><td>customization</td><td>object</td><td>Yes</td><td>It holds the transaction title, description</td></tr><tr><td>customization.title</td><td>string</td><td>Yes</td><td>Customization title</td></tr><tr><td>customization.description</td><td>string</td><td>No</td><td>Customization description</td></tr></tbody></table>

### Integration Guide

This is a command-line cURL command for making a POST request to the Skrape payment API.

```javascript
curl --location --request POST 'https://api.skrape.io/standard/payment' \
--header 'Authorization: Bearer ${SECRET}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "api_key": "sk_live_ffknsdksndse2233233232"
    "tx_ref": "randomuniqueid",
    "amount": 100,
    "redirect_url": "https://redirect.com",
    "customer": {
        "first_name":"user",
        "last_name":"test",
        "email":"user@mail.com",
        "phone_number":"08111111111"

    },
    "customization": {
        "title":"test 001",
        "description":"testing"
    },
    "callback_url": "https://callback.com"
}'
```

### Sample Response

```javascript
{
    "message": "Transaction created successfully",
    "data": {
        "link": "https://skrape.io/transaction/initialize/QTYPPDU9L1ghr0b29cO",
        "link_id": "QTYPPDU9L1ghr0b29cO"
    }
}
```

&#x20;The command does the following:

1. It uses the `curl` command to make a POST request to the `https://api.skrape.io/standard/payment` endpoint.
2. It sends a `Authorization` header with the request, containing an access token that authenticates the request. The token is stored in the `SECRET` environment variable.
3. It sends a `Content-Type` header with the request, set to `application/json`, indicating that the body of the request contains JSON-encoded data.
4. It sends a JSON-encoded payload in the body of the request, containing the following fields:
   * `api_key:` API key for the Skrape service, which authenticates the website to interact with the Skrape service
   * `tx_ref`: A unique reference for the transaction
   * `amount`: The amount of the payment
   * `redirect_url` : A redirect url for the user after successfull payment
   * `customer` : An object that contains the customer's first name, last name, email, phone\_number
   * `customization` : An object that contains title and description of the checkout page
   * `callback_url` : A callback URL that will be called after successful payment
5. After successful execution of the request , the API will process the payment and returns the response accordingly.

Please note that the command is given is just an example and you would need to replace the url, headers, and body contents with your own information accordingly.

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://skrape-docs.gitbook.io/skrape/accept-payments/skrape-standard.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
