Reference for parameters, methods, and error codes
This reference describes:
 
Reference of parameters for widget initialization
Description of parameters that must be sent to the instance of the
YooMoneyCheckoutWidget
class on the payment page for widget initialization.

ParameterTypeMandatoryDescription
confirmation_tokenstringRequiredYooMoney token for initializing the widget. To issue a token, create a payment
return_urlstringRequiredAddress of the page for redirecting the user after the payment is completed. The address must be absolute (with the protocol and website domain specified). Example:
https://example.com/orderid-1111
customizationobjectOptionalPayment form customization. Right now, you can customize the color scheme and the display of payment methods.
colorsobjectOptional
Sent in 
customization
.
Color scheme customization. Colors that must be changed in the payment form’s interface are sent in the object.
payment_methodsarrayOptional
Sent in 
customization
.
  • apple_pay
    — Apple Pay;
  • google_pay
    — Google Pay;
  • bank_card
    — bank card;
  • yoo_money
    — YooMoney (wallet, linked cards, and bonus points);
  • sberbank
    — Sberbank Online/SberPay.
You can only send a combination of the following codes simultaneously:
bank_card
,
apple_pay
, and
google_pay
.
 
Reference for color scheme configuration parameters
Description of all parameters in the
colors
object that can be used for configuring the color scheme.
ParameterDescriptionDefault
controlPrimary
Background color for accent elements: the Pay button, selected radio buttons, checkboxes, border of the selected text field. We recommend using a bright color to draw attention
#FFCC00
(yellow)
controlPrimaryContent
Color of the text in the Pay button and the contents of accent radio buttons and checkboxes (for example, a ticked checkbox). We recommend using a color that will contrast with
controlPrimary
.
If the parameter is not specified, the color will be determined on the basis of 
controlPrimary
#000000
(black) или
#FFFFFF
(white) — selected to contrast with
controlPrimary
backgroundPayment form background color, color of error messages and tips, appearance of the Apple Pay and Google Pay buttons and logos. We recommend using a color close to the background color of the container where the widget is placed
#FFFFFF
(white)
text
Color of all texts on the payment form except for the text in the Pay button and tooltips.
If the parameter is not specified, the color is determined on the basis of 
background
Contrast to 
background
borderColor of borders and separators.
If the parameter is not specified, the color is determined on the basis of 
background
Contrast to 
background
controlSecondaryColor of non-accent interface elements.
If the parameter is not specified, the color is determined on the basis of 
background
Contrast to 
background
 
Widget initialization errors
If the widget initialization failed, YooMoney will send an error code to the callback function.
Error codeValue
internal_service_errorError during payment creation. Repeat widget initialization
invalid_combination_of_payment_methodsInvalid combination of payment methods in 
payment_methods
of the
customization
object. Only
apple_pay
,
google_pay
, and
bank_card
can be sent simultaneously (any combination).
~invalid_payment_methodsIncorrect
payment_methods
value of the
customization
object. The array can only contain the codes of the payment methods supported by the widget. If you display several methods, their codes must be presented as a list separated by commas.
invalid_return_urlInvalid return URL. During widget initialization, specify the absolute URL of the payment completion page in 
return_url
with the protocol and domain of your website
invalid_tokenInvalid token. Create a payment to obtain a token
no_payment_methods_to_displayNo payment methods to display: for example, you can’t accept payments via the selected method or the selected payment method can’t be saved for autopayments (if you’re trying to do that). Send another payment method in 
payment_methods
during widget initialization.
return_url_requiredReturn URL not specified. Specify
return_url
during widget initialization
token_expiredToken has expired. Create a payment to obtain a new token
token_requiredToken not sent. Send
confirmation_token
during widget initialization
 
Description of widget’s methods
MethodTypeDescription
render
(id: string) => Promise<undefined>
Payment form display. Execution of Promise means the payment form is fully loaded. Use of Promise is optional.
destroy
() => void
Deletion of an initialized widget.

Do you have any questions or comments regarding the documentation?

We can set up a call and discuss them: we'll help you solve the problem and you'll help us understand what we need to improve. To do that, share your contact information and select the time.
Yes, I'd like to set up a meeting
 
See also
API ReferenceWidget integration