{"openapi":"3.1.0","info":{"title":"Payments","version":"1.0.0","description":"API reference for accepting payments with PayMe — sales via hosted payment page, hosted fields or direct API, tokens, subscriptions, refunds and captures, 3D Secure, invoices and point-of-sale. Start with Getting Started for credentials, environments and a first sale."},"servers":[{"url":"https://sandbox.payme.io/api","description":"Sandbox"},{"url":"https://live.payme.io/api","description":"Production"}],"components":{"securitySchemes":{"merchantKey":{"type":"apiKey","in":"header","name":"PayMe-Merchant-Key"},"partnerKey":{"type":"apiKey","in":"header","name":"PayMe-Partner-Key"},"publicKey":{"type":"apiKey","in":"header","name":"PayMe-Public-Key"},"signature":{"type":"apiKey","in":"header","name":"PayMe-Signature"}}},"tags":[{"name":"Apple Pay"}],"paths":{"/vas-enable":{"post":{"operationId":"post-vas-enable-apple-pay","summary":"Enable Apple Pay for a seller","tags":["Apple Pay"],"description":"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.\n\n## What happens\n\nFor 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](/accepting-payments/payment-methods/apple-pay#step-1-host-paymes-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.\n\n- Up to 99 domains per call. A domain can be sent with or without `https://`.\n- To add domains later, call `vas-enable` again with the new ones. Approved domains stay approved. (Partners can also use `vas-update`; contact PayMe support for its details.)\n\n## Errors\n\n| HTTP | `status_error_code` | When |\n|---|---|---|\n| 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. |\n| 400 | `20` | \"Validation error\": Apple refused the registration, and `status_additional_info` is `Domain is not registered`. |\n| 500 | `720` | The service was not activated. |\n\nSee [Accept Apple Pay](/accepting-payments/payment-methods/apple-pay) for the whole setup.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"payme_client_key":{"type":"string","description":"Your partner key. Keep it on your server."},"seller_payme_id":{"type":"string","description":"The seller's PayMe ID (MPL). The seller must belong to your partner."},"vas_payme_id":{"type":"string","description":"Your partner's Apple Pay service ID (`VASL…`)."},"vas_data":{"type":"object","description":"The service's settings.","properties":{"websites":{"type":"array","description":"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."}},"required":["websites"]},"language":{"type":"string","description":"Language of the error messages: `he` (default) or `en`."}},"required":["payme_client_key","seller_payme_id","vas_payme_id","vas_data"]},"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"}}}},"responses":{"200":{"description":"Apple Pay is enabled and the domains are registered.","x-response-kind":"success","content":{"application/json":{"schema":{"type":"object","properties":{"status_code":{"type":"number","description":"`0` on success."},"seller_payme_id":{"type":"string","description":"The seller's PayMe ID (MPL)."},"vas_payme_id":{"type":"string","description":"The `vas_payme_id` you sent."},"vas_guid":{"type":"string","description":"The ID of the seller's own service, created or re-enabled by this call."},"vas_description":{"type":"string","description":"The service's description."},"vas_type":{"type":"string","description":"The service type, `AlternativePaymentMethod`. See [VAS Types](/marketplaces-and-platforms/seller-reference/vas-types)."},"vas_name":{"type":"string","description":"The plan name, for creation-plan services only; `null` here."},"vas_api_key":{"type":"string","description":"The service's public API ID, if it has one; otherwise empty."},"vas_is_active":{"type":"boolean","description":"`true` when the service is active for the seller."},"vas_payer_type":{"type":"number","description":"Who pays for the service: `1` partner, `2` seller, `3` reseller."},"vas_price_currency":{"type":"string","description":"The currency the service is charged in."},"vas_price_setup_fixed":{"type":"number","description":"The service's setup price, fixed part."},"vas_price_periodic_fixed":{"type":"number","description":"The service's periodic price, fixed part."},"vas_price_periodic_variable":{"type":"string","description":"The service's periodic price, variable part."},"vas_price_usage_fixed":{"type":"number","description":"The service's price per use, fixed part."},"vas_price_usage_variable":{"type":"string","description":"The service's price per use, variable part."},"vas_market_fee":{"type":"number","description":"The market fee on the service, if one is set; otherwise `null`."},"vas_period":{"type":"number","description":"How often the service is charged: `1` instant, `2` daily, `3` monthly, `4` yearly."},"vas_data":{"type":"object","description":"The service's settings.","properties":{"websites":{"type":"array","description":"The approved domains, PayMe's own host included."}}}}},"example":{"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":{"description":"A domain failed the check (`703`), or Apple refused the registration (`20`).","x-response-kind":"error","content":{"application/json":{"schema":{"type":"object","properties":{"status_code":{"type":"number","description":"`1` for a failed request."},"status_error_code":{"type":"number","description":"PayMe's error code. See [Errors](/payments/getting-started/errors)."},"status_error_details":{"type":"string","description":"The error message, in the request's `language`."},"status_additional_info":{"type":"string","description":"More detail when there is any, for example the field or the site that failed; otherwise `null`."}}},"example":{"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":{"description":"The service was not activated (`720`).","x-response-kind":"error","content":{"application/json":{"schema":{"type":"object","properties":{"status_code":{"type":"number","description":"`1` for a failed request."},"status_error_code":{"type":"number","description":"PayMe's error code. See [Errors](/payments/getting-started/errors)."},"status_error_details":{"type":"string","description":"The error message, in the request's `language`."},"status_additional_info":{"type":"string","description":"More detail when there is any, for example the field or the site that failed; otherwise `null`."}}},"example":{"status_code":1,"status_error_details":"The service was not activated","status_additional_info":null,"status_error_code":720}}}}}}},"/generate-sale":{"post":{"operationId":"post-generate-sale-apple-pay","summary":"Create a Apple Pay sale","tags":["Apple Pay"],"description":"Creates a sale for Apple Pay. Send the buyer to `sale_url`, where PayMe's page shows Apple Pay, or pass `payme_sale_id` as `saleGuid` to `instance.appleSale()` to show Apple Pay on your own page: see [Accept Apple Pay](/accepting-payments/payment-methods/apple-pay).\n\nThe seller needs the Apple Pay service: a seller installs it from the dashboard app store (חנות אפליקציות), and a partner enables it with [vas-enable](/payments/apple-pay/post-vas-enable-apple-pay). Without it, the call fails with error `720`.\n\nApple Pay pays in a single payment: more than one `installments` fails with error `351`.\n\n**Auth:** `seller_payme_id` in the body. Call it from your server, never from the browser. Base URL: `https://sandbox.payme.io/api` in the sandbox, `https://live.payme.io/api` in production.\n\nThis page lists the fields a wallet sale needs. `generate-sale` takes more optional fields, such as `transaction_id`, `sale_callback_url` and `sale_return_url`: see [generate-sale](/payments/hosted-payment-page/post-generate-sale).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"seller_payme_id":{"type":"string","description":"The seller's PayMe ID (MPL)."},"sale_price":{"type":"integer","description":"Amount in minor units: `1000` = 10.00."},"currency":{"type":"string","description":"ISO 4217 currency code, e.g. `ILS`."},"product_name":{"type":"string","description":"What the payment is for."},"sale_payment_method":{"type":"string","description":"`apple-pay`."},"sale_type":{"type":"string","description":"Default `sale`. See [Sale Types](/payments/codes-statuses/sale-types)."},"language":{"type":"string","description":"Language of the payment page and the error messages: `he` (default) or `en`."}},"required":["seller_payme_id","sale_price","currency","product_name","sale_payment_method"]},"example":{"seller_payme_id":"MPLDEMO-MPLDEMO-MPLDEMO-1234567","sale_price":1000,"currency":"ILS","product_name":"Order 1234","sale_payment_method":"apple-pay","language":"en"}}}},"responses":{"200":{"description":"The sale was created.","x-response-kind":"success","content":{"application/json":{"schema":{"type":"object","properties":{"status_code":{"type":"number","description":"`0` on success."},"sale_url":{"type":"string","description":"PayMe's payment page for this sale. It shows Apple Pay."},"payme_sale_id":{"type":"string","description":"The sale's ID. Pass it to `instance.appleSale()` as `saleGuid`."},"payme_sale_code":{"type":"number","description":"A short numeric sale code, for display only."},"price":{"type":"number","description":"The amount, in minor units."},"transaction_id":{"type":"string","description":"Your own order ID, if you sent `transaction_id`; otherwise empty."},"currency":{"type":"string","description":"The sale's currency."},"sale_payment_method":{"type":"string","description":"`apple-pay`."}}},"example":{"status_code":0,"sale_url":"https://sandbox.payme.io/sale/generate/SALE1655-3843870J-NTPYLJNW-SOWRLK9X","payme_sale_id":"SALE1655-3843870J-NTPYLJNW-SOWRLK9X","payme_sale_code":1032526,"price":1000,"transaction_id":"","currency":"ILS","sale_payment_method":"apple-pay"}}}},"400":{"description":"The request is invalid. For example, error `351` when `installments` is more than 1.","x-response-kind":"error","content":{"application/json":{"schema":{"type":"object","properties":{"status_code":{"type":"number","description":"`1` for a failed request."},"status_error_code":{"type":"number","description":"PayMe's error code. See [Errors](/payments/getting-started/errors)."},"status_error_details":{"type":"string","description":"The error message, in the request's `language`."},"status_additional_info":{"type":"string","description":"More detail when there is any, for example the field or the site that failed; otherwise `null`."}}},"example":{"status_code":1,"status_error_details":"Please verify installments amount","status_additional_info":"installments are not allowed for apple-pay","status_error_code":351}}}},"500":{"description":"The request failed. For example, error `720` \"The service was not activated\" when the seller has no active Apple Pay service.","x-response-kind":"error","content":{"application/json":{"schema":{"type":"object","properties":{"status_code":{"type":"number","description":"`1` for a failed request."},"status_error_code":{"type":"number","description":"PayMe's error code. See [Errors](/payments/getting-started/errors)."},"status_error_details":{"type":"string","description":"The error message, in the request's `language`."},"status_additional_info":{"type":"string","description":"More detail when there is any, for example the field or the site that failed; otherwise `null`."}}},"example":{"status_code":1,"status_error_details":"The service was not activated","status_additional_info":"apple-pay","status_error_code":720}}}}}}}}}