Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with change price #15

Open
mleplawy opened this issue Jun 13, 2019 · 5 comments
Open

problem with change price #15

mleplawy opened this issue Jun 13, 2019 · 5 comments

Comments

@mleplawy
Copy link

mam problem ze zmianą ceny
$response=$api->offers(8198330586)->commands()->change_price(intval(intval("1400")));

zwraca mi błąd
{"errors":[{"code":"JsonMappingException","message":"Can not construct instance of pl.allegro.offercore.service.common.msg.command.ChangePriceMessage: no int/Int-argument constructor/factory method to deserialize from Number value (1400)\n at [Source: org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream@4d1fca34; line: 1, column: 1]","details":"JsonMappingException","path":null,"userMessage":null

@retrowaver
Copy link

Musisz przekazać całą strukturę ceny, a nie samego integera (swoją drogą nie integera, tylko stringa):

$response = $api->offers(8198330586)->commands()->change_price(
    [
        'input' => [
            'buyNowPrice' => [
                'amount' => '1400',
                'currency' => 'PLN'
            ]
        ]
    ]
)

https://developer.allegro.pl/command/
https://developer.allegro.pl/documentation/#operation/createChangePriceCommandUsingPUT

@mleplawy
Copy link
Author

dzieki doszedł już do tego a jak sie zachować w przypadku checi zmiany statusu aukcji tzn jej zawieszenia
`$data2=array ( 'publication' => array ( 'action' => 'END', ), 'offerCriteria' => array ( 0 => array ( 'offers' => array ( 0 => array ( 'id' => '7276377308', ), ), 'type' => 'CONTAINS_OFFERS', ), ), );

$api->offers()->commands()->offer_publication($data2);`

daje
{"errors":[{"code":"NotFoundException","message":"Not found","details":null,"path":null,"userMessage":"Function is not available. Contact the author of the application."}]}

@retrowaver
Copy link

Próbujesz robić requesta na złym zasobie. Spróbuj $api->sale->commands()->offer_publication(...)

@mleplawy
Copy link
Author

no tak ... Dziękuje bardzo:)

@mleplawy
Copy link
Author

zwraca mi coś takiego i nie zamyka aukcji
{"id":"0f75f9f1-3b4d-4da5-91b2-87610ef1baa0","taskCount":{"total":0,"success":0,"failed":0}}

@mleplawy mleplawy reopened this Jun 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants