# Integrate Api for Marketplace

## Base URL

```
https://api.freexcrypto.xyz/api
```

## Endpoint

### Payment Links

```http
POST /payment-links
```

Request body:

```json
{
  "business_id": "uuidv4",
  "title": "string",
  "description": "2024-03-20T23:59:59Z",
  "amount": "2024-03-20T23:59:59Z",
}
```

Response:

```json
{
  "id": "uuidv4",
  "business_id": "uuidv4",
  "title": "string",
  "description": "string",
  "payment_link": "https://freex.com/pay/pl_123456",
  "amount": "100.00",
  "expires_at": "2024-03-20T23:59:59Z",
  "status": "active"
}
```

### Orders

**Create Order**

```http
POST /order/onboarding
```

Request body:

```json
{
  "client_id": "string",
  "business_id": "uuidv4",
  "expired_at": "TIMESTAMPZ",
  "success_url": "https://yourapp.com/...",
  "items": [
    {
      "product_name": "Produk A",
      "product_price": 1,
      "quantity": 1
    },
    {
      "product_name": "Produk B",
      "product_price": 1,
      "quantity": 1
    }
  ]
}
```

Response:

```json
{
  "id": "12345",
  "client_id": "client_001",
  "chain_id": 1135,
  "sender_address_wallet": "null",
  "business_id": "uuidv4",
  "destination_address_wallet": "0x0987654321FEDCBA",
  "total_price": 150000,
  "expired_at": "2025-05-13T12:00:00Z",
  "payment_url": "https://www.freexcrypto.xyz/checkout/...",
  "success_url": "https://yourapp.com/...",
  "status_message": "active",
  "transaction_hash": null,
  "items": [
    {
      "id": "uuidv4",
      "name": "Produk A",
      "quantity": 2,
      "price": 50000
    },
    {
      "id": "uuidv4",
      "name": "Produk B",
      "quantity": 1,
      "price": 50000
    }
  ]
}
```

{% hint style="info" %}

#### Endpoint for GET Payment Links and GET Orders, will be updated in here as soon as possible.

{% endhint %}
