# Servipag

> Learn how to use Servipag as one of your payment methods in Chile with EBANX Direct API.

# Servipag

Servipag is a widely used payment method in Chile, supported by EBANX, that allows customers to pay for online purchases either through online banking or at physical payment locations. Servipag is a trusted solution in Chile, offering customers the flexibility to complete transactions in a way that best suits their preferences, whether via bank transfer, debit card, or cash. It is a reliable and secure option, particularly for customers in Chile who prefer bank transfers or cash payments for online purchases.

## Requirements

- **API authentication** - All API requests must be authenticated using [JWS (JSON Web Signature)](/docs/get-started/api-authentication/jws-authentication). The legacy `integration_key` is being deprecated — if you still use it, follow the [Migration Guide](/docs/get-started/api-authentication/jws-migration) to transition to JWS. If you don't have credentials yet, complete the [Merchant Signup Form](https://www.ebanx.com/en/contact/).
- **Familiarity with EBANX Direct** - This setup follows the same general structure as other payment methods, with a few unique parameters.

## How it works

- **Customer selects Servipag** - At checkout, your customer chooses Servipag as the payment method.
- **Generate payment voucher** - EBANX generates a payment voucher with a unique reference code and payment instructions.
- **Customer completes payment** - Your customer can either complete the payment online via Servipag’s platform or visit a physical Servipag location to pay in cash.
- **Payment confirmation** - Once the payment is made, Servipag processes it and sends confirmation to EBANX.
- **Merchant notified** - EBANX updates the payment status and notifies you, allowing you to fulfill your order.

This process ensures flexibility and convenience for Chilean customers using bank transfers or cash-based payments.

## Instructions

Follow the steps below.

### Select your environment
Select the appropriate environment for your integration. Use the sandbox environment for testing, or the production environment for live transactions. Use the URL for your HTTP requests based on your selection.

- **Cross-border sandbox:** `https://sandbox.ebanxpay.com/ws/direct`
- **Cross-border production:** `https://api.ebanxpay.com/ws/direct`
- **Local sandbox:** `https://sandbox-local-latam.ebanxpay.com/ws/direct`
- **Local production:** `https://api-local-latam.ebanxpay.com/ws/direct`

Check the method's availability for your country and tenant in [Payment Methods by Country](/docs/pay-in/processing/payment-methods/payment-methods-overview#payment-methods-by-country). Questions about tenant and environment? Check our [API Operability](/docs/get-started/api-operability) and [API Endpoints](/docs/get-started/api-endpoints).

### Define your parameters

With **Servipag**, customers are redirected to a secure third-party website to complete the payment quickly and safely. To obtain this redirection link, call the **/ws/direct** endpoint with the required parameters.

  At the API Reference Guide, select Chile and Servipag from the
  dropdown menus.

### Sample request

Use the following example to initiate a request.

```bash
curl -X POST \
  --location 'https://sandbox.ebanxpay.com/ws/direct' \
  --header 'Content-Type: application/json' \
  --data '{
    "integration_key": "{{integration_key}}",
    "payment": {
        "name": "John Doe",
        "email": "john.doe@example.com",
        "document": "{{tax_id}}",
        "phone_number": "5555555555",
        "country": "cl",
        "payment_type_code": "servipag",
        "merchant_payment_code": "{{unique_merchant_code}}",
        "currency_code": "CLP",
        "amount_total": 99.85
    }
}'
```

### Sample response

A successful request returns a response like the example below, with the third-party website link provided in the **payment.redirect_url** parameter.

```json
{
  "redirect_url": "{{redirect_url}}",
  "payment": {
    "hash": "59acc5f00945fa382ab051651440826da7701533249b3a475",
    "country": "cl",
    "merchant_payment_code": "{{unique_merchant_code}}",
    "status": "PE",
    "status_date": "{{YYYY-MM-DD HH:mm:ss}}",
    "open_date": "{{YYYY-MM-DD HH:mm:ss}}",
    "confirm_date": null,
    "transfer_date": null,
    "amount_br": "99.85",
    "amount_ext": "99.85",
    "amount_iof": "1",
    "currency_rate": "1",
    "currency_ext": "CLP",
    "due_date": "{{YYYY-MM-DD}}",
    "instalments": "1",
    "payment_type_code": "servipag",
    "pre_approved": false,
    "redirect_url": "{{redirect_url}}"
  },
  "status": "SUCCESS"
}
```

[Merchant Area](https://dashboard.ebanx.com)

### Redirect customer to the returned URL

Redirect your customer to the URL returned in the parameter `redirect_url`. After the redirection, your customer will be at a third-party website with all the necessary purchase details to finalize their payment securely.

#### **Testing Servipag in a sandbox environment**

In our Sandbox environment, we provide a Servipag simulation interface to test bank transfer payments. This mock interface allows you to simulate different payment outcomes:

- Simulate Authorized = YES: Confirms the payment as successful.
- Simulate Authorized = NO: Denies the payment.
- Leave Pending: Leaves the payment in a pending state.

This simulation mimics the real production flow, where users are redirected to their Internet Banking to complete transactions, enabling you to thoroughly test authorized and unauthorized payments.

![Servipag sandbox authorization interface with payment simulation options](/img/docs/pay-in/processing/payment-methods/country-specific/chile/servipag-authorization-sandbox.png)

### Monitor payment for status changes

**Notifications**

- EBANX will send a notification whenever a payment status changes.

- Make sure your system is set up to receive notifications from EBANX for any changes in payment status.

- [Learn more about Payment Notifications](/docs/pay-in/management/status-and-retrieval/payment-notifications)

**Status**

- After receiving a notification that status has changed, retrieve the payment status.

- When a payment is confirmed, the status will change from **pending (PE)** to **confirmed (CO)**.
  If the customer does not complete the payment, the status will eventually change to **cancelled (CA)**.

- [Learn more about Retrieving Payment Status](/docs/pay-in/management/status-and-retrieval/retrieve-payment)

### Congratulations!

You have successfully integrated **Servipag**.

For more information, refer to the [Direct API reference guide](/api-reference?api=pay-in&page=direct)

## Resources

Use the following resources when testing in your sandbox environment.
- [Sample Cards](/docs/pay-in/dev-tools/sandbox-simulation/test-credit-cards)
- [API Reference](/api-reference)
- [Mock Customer Data](/docs/pay-in/dev-tools/sandbox-simulation/test-customer-data)
- [Error Codes](/docs/pay-in/dev-tools/response-codes/api-error-codes)
## Still need help?

If you still have questions, you can explore the following options:

- **Merchant support:** Contact our support team at [sales.engineering@ebanx.com](mailto:sales.engineering@ebanx.com) for assistance.
- **Not a partner yet?** Complete the [Merchant Signup Form](https://business.ebanx.com/en/request-contact), and our commercial team will reach out to you.
