Advertisement renewal¶
You can renew an existing advertisement by POST against the advertisement resource. Renewal can only be done when
the advertisement is about to expire. Normally, this is 7 days and can be verified using by inspecting the renewalPossible
field on the advertisement.
A renewal of an advertisement automatically result in an upcall in case the user has invoice_allowed as a privilege. Effectively,
renewing the advertisement had the same effect as deleting the advertisement and creating the exact same advertisement
again.
field | type | constraints | default | Req | W | U |
---|---|---|---|---|---|---|
orderId | int | – | no | yes | no | |
pay | boolean | – | yes | yes | no |
orderId
Optional argument that when specified indicates that these products should be added to an existing order rather than that a new order should be created (not yet implemented)
pay
When set to true indicates that you want to immediately pay for the order via invoicing (only API partners can do this) ONLY TRUE IS CURRENTLY SUPPORTED
Example¶
Renewal of advertisment id=12345 :
Request :
POST /v1/advertisements/12345/renew HTTP/1.1 Host: api.marktplaats.nl Content-Type: application/json { "pay":true }Response :
HTTP/1.1 201 Created Location: https://api.marktplaats.nl/v1/orders/123 Content-Location: https://api.marktplaats.nl/v1/orders/123 Content-Type: application/json { "_links": { "self": { "href": "/v1/orders/123" }, "curies": [ { "name": "mp", "href": "https://api.marktplaats.nl/docs/v1/{rel}.html", "templated": true } ] }, "_embedded": { "mp:product": [ { "_links": { "self": { "href": "/v1/orders/123/products/2432" } }, "productId": "2432", "description": "product_description", "price": "1234" } ] }, "orderId": 123, "status": "paid", "price": 1234 }
Errors¶
http | error code | description |
---|---|---|
404 | advertisement-not-found | The provided advertisement id (itemId) is unknown |
400 | extension-not-supported | It is not possible to extend the advertisement. This can have various reasons. |
400 | invalid-expiration | Renewal is not possible because item is not in expiration period |
400 | invalid-item-id | Renewal is not possible because item is not renewable |
403 | unauthorized | The action you are trying to perform is not allowed |