sverraest / revolut-php

💳 PHP Bindings for the Revolut Business API

Home Page:https://revolutdev.github.io/business-api/#api-v1-0-introduction

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

counterparties->create does not work

itsoft7 opened this issue · comments

Hello.

Did you check creation counterparty on working account? Very strange that it does not work.

$client->counterparties->create(['company_name' => 'RS PREHODNI DAVČNI PODRAČUN', 'bank_country' => 'SI' , 'currency' => 'EUR',
'address' => ['street_line1' => 'Gregorčičeva ulica 20', 'street_line2' => '1000 Ljubljana'],
'iban' => 'SI56011008883000073', 'bic' => 'BSLJSI2X']);

sends:

Authorization: Bearer oa_prod_qofi3bp****
User-Agent: GuzzleHttp/6.5.5 curl/7.72.0 PHP/7.3.21
Content-Type: application/json
Content-Length: 232

{"company_name":"RS PREHODNI DAV\u010cNI PODRA\u010cUN","bank_country":"SI","currency":"EUR","address":{"street_line1":"Gregor\u010di\u010deva ulica 20","street_line2":"1000 Ljubljana"},"iban":"SI56011008883000073","bic":"BSLJSI2X"}

Revolut responses: {"message":"Required 'country' is missing","code":3000}

I tried

curl -X POST https://b2b.revolut.com/api/1.0/counterparty
-H "Authorization: Bearer oa_prod_qof***"
-H "User-Agent: GuzzleHttp/6.5.5 curl/7.72.0 PHP/7.3.21"
-H "Content-Type: application/json"
--data @- << EOF

{"company_name":"RS PREHODNI DAV\u010cNI PODRA\u010cUN","bank_country":"SI","currency":"EUR","address":{"street_line1":"Gregor\u010di\u010deva ulica 20","street_line2":"1000 Ljubljana"},"iban":"SI56011008883000073","bic":"BSLJSI2X"}

EOF

Result is the same.

But this one works!
curl -X POST https://b2b.revolut.com/api/1.0/counterparty
-H "Authorization: Bearer oa_prod_li***"
--data @- << EOF

{
"company_name": "RS PREHODNI DAVČNI PODRAČUN",
"bank_country": "SI",
"currency": "EUR",
"iban": "SI56011008883000073",
"bic": "BSLJSI2X",
"address": {
"street_line1": "Gregorčičeva ulica 20",
"street_line2": "1000 Ljubljana",
"postcode": "1000",
"city": "Ljubljana",
"country": "SI"
}
}

EOF

The difference only in new line as I see.

The similar sitation with payment.

Hm... https://revolut-engineering.github.io/api-docs/business-api/#api-reference-api-reference-counterparties-add-non-revolut-counterparty

In response they mean field address.country

And this field is not required.

Problem is solved. Sorry.

Problem was in inaccurate revolut documentation.