Pay

Credentials

No credentials are documented for this endpoint.

Overview

Relevant only for Direct API Integration

This endpoint is used to pay subscriptions. You can find more information in our guide - How to create a subscription .

Parameters

This endpoint takes no path, query or header parameters.

Request body

Content type: application/json

Field Type Required Description
sub_payme_id string no Our unique subscription ID
credit_card_number string no Buyer's credit card number
credit_card_cvv string no Buyer's credit card CVV
credit_card_exp string no Buyer's credit card expiary date
buyer_email string no Buyer's email address
buyer_name string no Buyer's full name

Request example

{
  "sub_payme_id": "SUB16885-68336QPL-UQSSS1CC-SYKXI53N",
  "credit_card_number": "4580458045804580",
  "credit_card_cvv": "123",
  "credit_card_exp": "0130",
  "buyer_email": "chen_text@gmail.com",
  "buyer_name": "sarit hadad"
}

Code samples

curl

curl -X POST 'https://sandbox.payme.io/api/pay-subscription' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "sub_payme_id": "SUB16885-68336QPL-UQSSS1CC-SYKXI53N",
  "credit_card_number": "4580458045804580",
  "credit_card_cvv": "123",
  "credit_card_exp": "0130",
  "buyer_email": "chen_text@gmail.com",
  "buyer_name": "sarit hadad"
}'

Node.js

const response = await fetch("https://sandbox.payme.io/api/pay-subscription", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "sub_payme_id": "SUB16885-68336QPL-UQSSS1CC-SYKXI53N",
    "credit_card_number": "4580458045804580",
    "credit_card_cvv": "123",
    "credit_card_exp": "0130",
    "buyer_email": "chen_text@gmail.com",
    "buyer_name": "sarit hadad"
  }),
});

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

Python

import requests

response = requests.post(
    "https://sandbox.payme.io/api/pay-subscription",
    json={
        "sub_payme_id": "SUB16885-68336QPL-UQSSS1CC-SYKXI53N",
        "credit_card_number": "4580458045804580",
        "credit_card_cvv": "123",
        "credit_card_exp": "0130",
        "buyer_email": "chen_text@gmail.com",
        "buyer_name": "sarit hadad",
    },
)

print(response.text)

PHP

<?php

$body = <<<'BODY'
{
  "sub_payme_id": "SUB16885-68336QPL-UQSSS1CC-SYKXI53N",
  "credit_card_number": "4580458045804580",
  "credit_card_cvv": "123",
  "credit_card_exp": "0130",
  "buyer_email": "chen_text@gmail.com",
  "buyer_name": "sarit hadad"
}
BODY;

$ch = curl_init('https://sandbox.payme.io/api/pay-subscription');
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 integer Cancellation status code ( 0 - Success, 1 - Failure)
payme_status string PayMe status
seller_payme_id string Our unique seller ID (MPL)
sub_payme_id string Subscription ID
sub_payme_code integer Subscription code
sub_created string Subscription creation timestamp
sub_start_date string Subscription start timestamp
sub_prev_date string Subscription last payment date
sub_next_date string Subscription next payment date
sub_status integer You can find all the subscription statuses here
sub_iteration_type integer You can find all the subscription iteration types here
sub_currency string Subscription currency
sub_price integer Total subscription price
sub_description string Subscription description
sub_iterations integer Number of iterations
sub_iterations_completed integer Number of iterations that was paid
sub_iterations_skipped integer The count of unpaid iterations and their corresponding dates have elapsed.
sub_iterations_left integer The count of iterations left
sub_paid boolean Indicates if the current iteration paid
sub_payment_date string The payment due date
buyer_card_mask string Buyer's credit card number
buyer_card_exp string Buyer's credit card expiary date
buyer_name string Buyer's full name
buyer_email string Buyer's email address
buyer_phone string Buyer's phone number
buyer_social_id string Buyer's social ID
{
  "status_code": 0,
  "payme_status": "success",
  "status_error_code": 0,
  "seller_payme_id": "MPL16861-35251ZB5-PLVPEMCW-ZUAQJBQO",
  "sub_payme_id": "SUB16885-68336QPL-UQSSS1CC-SYKXI53N",
  "sub_payme_code": 477004,
  "sub_created": "2023-07-05 17:45:36",
  "sub_start_date": "2023-07-05 17:45:36",
  "sub_prev_date": null,
  "sub_next_date": "2023-07-05 17:45:36",
  "sub_status": 2,
  "sub_iteration_type": 1,
  "sub_currency": "USD",
  "sub_price": 100,
  "sub_description": "sub-description",
  "sub_iterations": -1,
  "sub_iterations_completed": 0,
  "sub_iterations_skipped": 0,
  "sub_iterations_left": -1,
  "sub_paid": true,
  "sub_error_text": null,
  "sub_payment_date": "2022-08-15 15:51:29",
  "buyer_card_mask": "458045******4580",
  "buyer_card_exp": "0130",
  "buyer_name": "Jhon Doe",
  "buyer_email": "test@gmail.com",
  "buyer_phone": null,
  "buyer_social_id": null
}

500 — Internal Server Error (error)

Field Type Description
status_code number Status code 1 (for failure)
status_error_details string What caused the error
status_additional_info string The parameters related to the error
status_error_code number Status error code - 1
{
  "status_code": 1,
  "status_error_details": "Required parameter is missing",
  "status_additional_info": "seller_payme_id",
  "status_error_code": 1
}