Buy advertisement feature

You can buy features for an advertisement by doing performing POST against the buy feature controller resource. Buying features for an advertisement is only possible when the authenticated user owns the advertisement.

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

Reference

POST /v1/advertisements/{itemId}/features/{featurename}/buy-feature

Purchase a feature

Example

Buying a dagtopper :

Request :

POST /v1/advertisements/m1/features/dagtopper/buy-feature 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": "dagtopper",
       "price": "3000"
     }
   ]
 },
 "orderId": 123,
 "status": "paid",
 "price": 3000
}

Errors

http

error code

description

400

feature-not-allowed

The given feature cannot be bought by the current user. This is usually because the feature requires special privileges. If you think you really need this feature, contact us for more information.

400

invalid-feature-type

The provided feature type is invalid

400

invalid-order-state

The provided order cannot be modified

403

unauthorized

The action you are trying to perform is not allowed

400

unknown-order

The provided order id is unknown