Enable Apple Pay for a seller

Credentials

Enables Apple Pay for one of your sellers and registers the domains that show the Apple Pay button on your own pages. Partner-only: authenticate with payme_client_key. A seller can install Apple Pay itself from the dashboard app store (חנות אפליקציות). Base URL: https://sandbox.payme.io/api in the sandbox, https://live.payme.io/api in production.

What happens

For each domain in vas_data.websites, PayMe fetches https://<domain>/.well-known/apple-developer-merchantid-domain-association and compares it byte for byte with PayMe's file for the environment you call. The sandbox and production files differ: see Host PayMe's domain file. If every domain passes, PayMe registers the domains with Apple in the same call and returns the approved ones in vas_data.websites, together with PayMe's own host.

Errors

HTTP status_error_code When
400 703 A domain's file is missing or different. status_additional_info names each site: <site>: Certificate does not match, please reconfigure. or <site>: Cannot locate certificate. Also when you send more than 99 domains. Fix the file and send the call again: nothing is left pending.
400 20 "Validation error": Apple refused the registration, and status_additional_info is Domain is not registered.
500 720 The service was not activated.

See Accept Apple Pay for the whole setup.

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 partner key. Keep it on your server.
seller_payme_id string yes The seller's PayMe ID (MPL). The seller must belong to your partner.
vas_payme_id string yes Your partner's Apple Pay service ID (VASL…).
vas_data object yes The service's settings.
vas_data.websites array yes The domains that show the Apple Pay button, e.g. shop.example.com, with or without https://. Each must serve PayMe's domain file before the call. Up to 99.
language string no Language of the error messages: he (default) or en.

Request example

{
  "payme_client_key": "payme_partner_key",
  "seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567",
  "vas_payme_id": "VASLDEMO-VASLDEMO-VASLDEMO-1234567",
  "vas_data": {
    "websites": [
      "example.com",
      "shop.example.com"
    ]
  },
  "language": "en"
}

Code samples

curl

curl -X POST 'https://sandbox.payme.io/api/vas-enable' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "payme_client_key": "payme_partner_key",
  "seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567",
  "vas_payme_id": "VASLDEMO-VASLDEMO-VASLDEMO-1234567",
  "vas_data": {
    "websites": [
      "example.com",
      "shop.example.com"
    ]
  },
  "language": "en"
}'

Node.js

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_partner_key",
    "seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567",
    "vas_payme_id": "VASLDEMO-VASLDEMO-VASLDEMO-1234567",
    "vas_data": {
      "websites": [
        "example.com",
        "shop.example.com"
      ]
    },
    "language": "en"
  }),
});

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

Python

import requests

response = requests.post(
    "https://sandbox.payme.io/api/vas-enable",
    json={
        "payme_client_key": "payme_partner_key",
        "seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567",
        "vas_payme_id": "VASLDEMO-VASLDEMO-VASLDEMO-1234567",
        "vas_data": {
            "websites": [
                "example.com",
                "shop.example.com",
            ],
        },
        "language": "en",
    },
)

print(response.text)

PHP

<?php

$body = <<<'BODY'
{
  "payme_client_key": "payme_partner_key",
  "seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567",
  "vas_payme_id": "VASLDEMO-VASLDEMO-VASLDEMO-1234567",
  "vas_data": {
    "websites": [
      "example.com",
      "shop.example.com"
    ]
  },
  "language": "en"
}
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 — Apple Pay is enabled and the domains are registered. (success)

Field Type Description
status_code number 0 on success.
seller_payme_id string The seller's PayMe ID (MPL).
vas_payme_id string The vas_payme_id you sent.
vas_guid string The ID of the seller's own service, created or re-enabled by this call.
vas_description string The service's description.
vas_type string The service type, AlternativePaymentMethod. See VAS Types.
vas_name string The plan name, for creation-plan services only; null here.
vas_api_key string The service's public API ID, if it has one; otherwise empty.
vas_is_active boolean true when the service is active for the seller.
vas_payer_type number Who pays for the service: 1 partner, 2 seller, 3 reseller.
vas_price_currency string The currency the service is charged in.
vas_price_setup_fixed number The service's setup price, fixed part.
vas_price_periodic_fixed number The service's periodic price, fixed part.
vas_price_periodic_variable string The service's periodic price, variable part.
vas_price_usage_fixed number The service's price per use, fixed part.
vas_price_usage_variable string The service's price per use, variable part.
vas_market_fee number The market fee on the service, if one is set; otherwise null.
vas_period number How often the service is charged: 1 instant, 2 daily, 3 monthly, 4 yearly.
vas_data object The service's settings.
vas_data.websites array The approved domains, PayMe's own host included.
{
  "status_code": 0,
  "seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567",
  "vas_payme_id": "VASLDEMO-VASLDEMO-VASLDEMO-1234567",
  "vas_guid": "VASLDEMO-VASLDEMO-VASLDEMO-7654321",
  "vas_type": "AlternativePaymentMethod",
  "vas_name": null,
  "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,
  "vas_data": {
    "websites": [
      "example.com",
      "shop.example.com"
    ]
  }
}

400 — A domain failed the check (703), or Apple refused the registration (20). (error)

Field Type Description
status_code number 1 for a failed request.
status_error_code number PayMe's error code. See Errors.
status_error_details string The error message, in the request's language.
status_additional_info string More detail when there is any, for example the field or the site that failed; otherwise null.
{
  "status_code": 1,
  "status_error_details": "Action is not permitted",
  "status_additional_info": "shop.example.com: Certificate does not match, please reconfigure.",
  "status_error_code": 703
}

500 — The service was not activated (720). (error)

Field Type Description
status_code number 1 for a failed request.
status_error_code number PayMe's error code. See Errors.
status_error_details string The error message, in the request's language.
status_additional_info string More detail when there is any, for example the field or the site that failed; otherwise null.
{
  "status_code": 1,
  "status_error_details": "The service was not activated",
  "status_additional_info": null,
  "status_error_code": 720
}