VAS Charge

Credentials

No credentials are documented for this endpoint.

Overview

This enpoint allows our users to create a new VAS based on the usage fixed value only.

Parameters

Name In Type Required Description
PayMe-Partner-Key header string yes The partner's secret key.
PayMe-Merchant-Key header string no The MPL of the seller.
vasGuid path string yes

Request body

Content type: application/json

Field Type Required Description
charge_now boolean no Charge now = true means immediate charge to the card, if successful charges and credits are created, if failed charge is rollbacked immediately. Charge now = false means the charge will be created immediately but we won't try to charge the card.

Request example

{
  "charge_now": true
}

Code samples

curl

curl -X POST 'https://sandbox.payme.io/api/vas-links/<vasGuid>/charge' \
  -H 'Content-Type: application/json' \
  -H 'PayMe-Partner-Key: <PayMe-Partner-Key>' \
  --data-raw '{
  "charge_now": true
}'

Node.js

const response = await fetch("https://sandbox.payme.io/api/vas-links/<vasGuid>/charge", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "PayMe-Partner-Key": "<PayMe-Partner-Key>",
  },
  body: JSON.stringify({
    "charge_now": true
  }),
});

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

Python

import requests

response = requests.post(
    "https://sandbox.payme.io/api/vas-links/<vasGuid>/charge",
    headers={
        "PayMe-Partner-Key": "<PayMe-Partner-Key>",
    },
    json={
        "charge_now": True,
    },
)

print(response.text)

PHP

<?php

$body = <<<'BODY'
{
  "charge_now": true
}
BODY;

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

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

echo $response;

Responses

200 — OK (success)

Field Type Description
status_code integer
items object
items.charges object
items.charges.Payer array
items.charges.Payer[].charge_description string
items.charges.Payer[].charge_amount number
items.charges.Payer[].charge_currency string
items.charges.Payer[].charge_release_date string
items.charges.System array
items.charges.System[].charge_description string
items.charges.System[].charge_amount number
items.charges.System[].charge_currency string
items.charges.System[].charge_release_date string
{
  "status_code": 0,
  "items": {
    "charges": {
      "Payer": [
        {
          "charge_description": "Keep שירותי הנהלת חשבונות",
          "charge_amount": 58.5,
          "charge_currency": "ILS",
          "charge_release_date": "2023-06-29 11:37:35"
        }
      ],
      "System": [
        {
          "charge_description": "Keep שירותי הנהלת חשבונות",
          "charge_amount": -58.5,
          "charge_currency": "ILS",
          "charge_release_date": "2023-06-29 11:37:35"
        }
      ]
    }
  }
}