Form description request

Description

To request the form description, send a GET request to the address:

https://money.yandex.ru/api/showcase/<pattern_id>

The request is equivalent to downloading a document from a remote server.

We recommend client-side caching for the description of simple forms, since these form descriptions rarely change.

Do not cache subsequent steps in multistep forms, since their state depends on the data entered by the buyer at the first step.

Request format

GET /api/showcase/<pattern_id> HTTP/1.1
Host: money.yandex.ru
Accept-Language: <lang>
Accept-Encoding: <gzip>
If-Modified-Since: <date>

Request URL parameters:

Attribute Type Description
pattern_id string Payment Pattern ID.

The request may contain the following HTTP headers:

Header Description
Accept-Language The code of the language that the client wants to get the form description in, conforming to

RFC-5646: Tags for Identifying Languages

IANA Language Subtag Registry

Possible values:

  • ru — Russian
  • en — English

By default: Russian.

Accept-Encoding

Indicates client support for traffic compression. Supported values:

By default: file compression is not used.

If-Modified-Since

If the payment form description was stored in the client's cache, it indicates the Last-Modified value for the server's response to the previous request.

If the client does not cache form descriptions, the header is omitted.

The method returns one of the following responses:

  • The payment form description.
  • Indication that the form does not exist.
  • Indication that a different form should be used.
  • Indication that the form has not changed since the previous request.

Possible HTTP response codes:

HTTP response code Description
300 Multiple Choices Success. The response contains the payment form description. The address for sending the form to is given in the HTTP Location header.
301 Moved Permanently A different form should be used instead of the requested payment form. The address of the new form is given in the HTTP Location header. The response body is omitted.
304 Not Modified The payment form description has not changed since the previous request. The response body is omitted.
404 File Not Found The requested payment form does not exist or is not allowed to be used. The response body is omitted.
500 Internal Server Error The service is temporarily unavailable for technical reasons.

The server response contains the following special HTTP headers:

HTTP response code Description
Location The address for sending form data to the server. Alternatively, it is the new address of the form, if a different form should be used.
Content-Encoding gzip, if the client requested traffic compression.
Cache-Control

Indicates the client-side caching mode. Possible values:

  • private — The payment form description should be stored on the client side.
  • no-cache — The payment form description must not be cached.
Last-Modified Date and time of the latest changes to the form description.
For clarity, some of the examples below are shown as formatted, without compression. The server returns JSON-compact as a compressed format.

Example

Example: Returned description of a simple form or the first step of a multistep form.
HTTP/1.1 300 Multiple Choices Location: https://money.yandex.ru/api/showcase/5551Content-Type: application/jsonContent-Length: 539Cache-Control: privateLast-Modified: Thu, 17 Jul 2014 09:00:25 GMT{"money_source":["wallet","cards","payment-card","cash"],"title":"Bills","hidden_fields":{"ShopID":"13423","ShopArticleID":"35241","ShowCaseID":"3005","ContractTemplateID":"524867","budgetDocNumber":"0","has_external_status":"","is_withdrawal":""},"form":[{"type":"text","name":"supplierInn","hint":"10 digits (12 digits for sole proprietors)","label":"Recipient INN:","alert":"Please enter the recipient's INN","required":true,"readonly":false,"minlength":10,"maxlength":12,"pattern":"^\\d{10}$|^\\d{12}$"},{"type":"submit","label":"Continue"}]} 
Example: Redirection to a new form.
HTTP/1.1 301 Moved Permanently
Location: https://money.yanex.ru/api/showcase/5551
Example: The payment form does not exist or is not allowed to be used.
HTTP/1.1 301 Moved Permanently
Location: https://money.yanex.ru/api/showcase/5551
Example: The payment form does not exist or is not allowed to be used.
HTTP/1.1 404 Not Found
Content-Length: 0