Delayed Market Fee

Credentials

No credentials are documented for this endpoint.

Overview

This endpoint allows you to create a new charge (fee) that is connected to a sale and is limited by the transaction amount.

Limitations

  1. You must include at least one of the following - market_fee_percentage or market_fee_fixed
  2. The sale must be generated by the MPL
  3. market_fee_percentage - can be from 0.0 to 60.0
  4. market_fee_fixed - limited to the amount settled to the wallet and cannot be higher than that.

Parameters

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

Request body

Content type: application/json

Field Type Required Description
market_fee_percentage number no The percentage that will be charged. Limited to be between 0 to 60.
market_fee_fixed integer no The fixed market fee - limited to the amount settled to the wallet.

Request example

{
  "market_fee_percentage": 10.2,
  "market_fee_fixed": 15000
}

Code samples

curl

curl -X PATCH 'https://sandbox.payme.io/api/sales/<guid>/external-market-fee' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "market_fee_percentage": 10.2,
  "market_fee_fixed": 15000
}'

Node.js

const response = await fetch("https://sandbox.payme.io/api/sales/<guid>/external-market-fee", {
  method: "PATCH",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "market_fee_percentage": 10.2,
    "market_fee_fixed": 15000
  }),
});

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

Python

import requests

response = requests.patch(
    "https://sandbox.payme.io/api/sales/<guid>/external-market-fee",
    json={
        "market_fee_percentage": 10.2,
        "market_fee_fixed": 15000,
    },
)

print(response.text)

PHP

<?php

$body = <<<'BODY'
{
  "market_fee_percentage": 10.2,
  "market_fee_fixed": 15000
}
BODY;

$ch = curl_init('https://sandbox.payme.io/api/sales/<guid>/external-market-fee');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PATCH',
    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 0 - Sucess 1 - Failure
payme_status string The status of the action.
payme_sale_id string The sale the fee was associated with.
{
  "status_code": 0,
  "payme_status": "success",
  "payme_sale_id": "SALEGUID-SALEGUID-SALEGUID-SALEGUID"
}