Answer the question
In order to leave comments, you need to log in
Why is there an error in the qiwi API when transferring to a bank card?
Trying to send money to Russian VISA:
$option = [
'id' => 1000*strtotime('now'),
'fields' => ['account' => '42767************'],
'sum' => ['amount' => 100, 'currency' => '643'],
'paymentMethod' => ['type' => 'Account', 'accountId' => '643'],
];
$token_qiwi = "**************";
$zapros = curl_init();
$arr[CURLOPT_URL] = 'https://edge.qiwi.com/sinap/api/v2/terms/1963/payments';
$arr[CURLOPT_RETURNTRANSFER] = TRUE;
$arr[CURLOPT_TIMEOUT] = 10;
$arr[CURLOPT_HTTPHEADER] = array("Accept: application/json", "Content-type: application/json", "Authorization: Bearer ".$token_qiwi);
$arr[CURLOPT_POST] = TRUE;
$arr[CURLOPT_POSTFIELDS] = json_encode($option);
curl_setopt_array($zapros, $arr);
echo curl_exec($zapros);
curl_close($zapros);
{"message":"Json validation error List((obj.id,List(JsonValidationError(List(error.expected.jsstring),WrappedArray()))))"}
Answer the question
In order to leave comments, you need to log in
Tell me what am I doing wrong?you don't read the error, there is error.expected.jsstring Slightly strain your brain, they want a string from you, let's figure out where?
already read all the documentation along and reproachedI don’t know what you read there, but when they write to you about a validation error, you need to run to the descriptions of the request structure and check each type
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question