# Activate Service (Google Pay)

This is a variant of [POST /vas-enable — Order New POS Device](/payments-migrated/point-of-sale-pos/post-vas-enable); the request and responses below are the ones documented for Google Pay.

- Sandbox: `POST https://sandbox.payme.io/api/vas-enable`
- Production: `POST https://live.payme.io/api/vas-enable`

## Credentials

- Request body field `payme_client_key` (required): Your PayMe API Partner Key.
- Request body field `seller_payme_id` (required): The unique seller ID the service is activated for.
- Request body field `vas_payme_id` (required): The service activation unique partner ID.

## Overview

#### **Google Pay VAS-Enable** 

In order to be able to use Google Pay in our platform, you will need to set up the service via API, using our VAS Enable request. 



The request works as in the following form:

```json
{
  "payme_client_key": "payme_partner_key",
  "seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567",
  "vas_payme_id": "VASLDEMO-VASLDEMO-VASLDEMO-1234567",
  "language": "en"
}
```

A successful response will be 200 and includes a payload in the form of:

```json
{
    "status_code": 0,
    "seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567",
    "vas_payme_id": "VASLDEMO-VASLDEMO-VASLDEMO-1234567",
    "vas_description": "Payments Account",
    "vas_type": "AlternativePaymentMethod",
    "vas_api_key": "",
    "vas_is_active": true,
    "vas_payer_type": 2,
    "vas_price_currency": "ILS",
    "vas_price_setup_fixed": 0,
    "vas_price_periodic_fixed": 0,
    "vas_price_periodic_variable": "0.00",
    "vas_price_usage_fixed": 0,
    "vas_price_usage_variable": "0.00",
    "vas_market_fee": null,
    "vas_period": 1
}
```

A failed response will be 500 and includes a payload in the form of:
```json
{
    "status_code": 1,
    "status_error_details": "The service was not activated",
    "status_additional_info": null,
    "status_error_code": 720
}
```

## Parameters

This endpoint takes no path, query or header parameters.

## Request body

Content type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payme_client_key` | string | yes | Your PayMe API Partner Key. |
| `seller_payme_id` | string | yes | The unique seller ID the service is activated for. |
| `vas_payme_id` | string | yes | The service activation unique partner ID. |
| `language` | string | yes |  |

### Request example

```json
{
  "payme_client_key": "payme_partnerkey",
  "seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567",
  "vas_payme_id": "VASLDEMO-VASLDEMO-VASLDEMO-1234567",
  "language": "he"
}
```

## Code samples

### curl

```bash
curl -X POST 'https://sandbox.payme.io/api/vas-enable' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "payme_client_key": "payme_partnerkey",
  "seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567",
  "vas_payme_id": "VASLDEMO-VASLDEMO-VASLDEMO-1234567",
  "language": "he"
}'
```

### Node.js

```javascript
const response = await fetch("https://sandbox.payme.io/api/vas-enable", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "payme_client_key": "payme_partnerkey",
    "seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567",
    "vas_payme_id": "VASLDEMO-VASLDEMO-VASLDEMO-1234567",
    "language": "he"
  }),
});

console.log(await response.text());
```

### Python

```python
import requests

response = requests.post(
    "https://sandbox.payme.io/api/vas-enable",
    json={
        "payme_client_key": "payme_partnerkey",
        "seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567",
        "vas_payme_id": "VASLDEMO-VASLDEMO-VASLDEMO-1234567",
        "language": "he",
    },
)

print(response.text)
```

### PHP

```php
<?php

$body = <<<'BODY'
{
  "payme_client_key": "payme_partnerkey",
  "seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567",
  "vas_payme_id": "VASLDEMO-VASLDEMO-VASLDEMO-1234567",
  "language": "he"
}
BODY;

$ch = curl_init('https://sandbox.payme.io/api/vas-enable');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => $body,
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
```

## Responses

### 200 — OK (success)

| Field | Type | Description |
| --- | --- | --- |
| `status_code` | number | 0 - Success 1 - Failure |
| `seller_payme_id` | string | Our unique seller ID. |
| `vas_payme_id` | string | The partner unique service API key. |
| `vas_description` | string | The description of the service that was activated. |
| `vas_type` | string | The type of the service that was activated. You can find all the VAS types [VAS Types](/guides-and-use-cases-migrated/lists-statuses/vas-types). |
| `vas_api_key` | string | Empty by default. |
| `vas_is_active` | boolean | Was the service activated successfully |
| `vas_payer_type` | number | Internal payer identity. 1 = Partner 2 = Seller 3 = Reseller |
| `vas_price_currency` | string | The currency that the service is charged in. |
| `vas_price_setup_fixed` | number | Partner account configuration of the setup costs. |
| `vas_price_periodic_fixed` | number | Partner account configuration of the periodical costs. |
| `vas_price_periodic_variable` | string | Partner account configuration of the periodical costs. |
| `vas_price_usage_fixed` | number | Partner account configuration of the fixed costs. |
| `vas_price_usage_variable` | string | Partner account configuration of the usage costs. |
| `vas_period` | number |  |

### 500 — Request Failed (error)

| Field | Type | Description |
| --- | --- | --- |
| `status_code` | number | Status code - will always be 1 for failed requests. |
| `status_error_details` | string | Reasons for the failed request. |
| `status_additional_info` | string |  |
| `status_error_code` | number | Error code for further support. |
