Advertisement transactions¶
Collection of embedded transaction representations.
Reference¶
POST /v1/advertisements/{itemId}/transactions
Create a new transaction
GET /v1/advertisements/{itemId}/transactions
Returns all transactions on the advertisement ordered by transactionId.
Errors¶
http | error code | description |
---|---|---|
404 | advertisement-not-found | The advertisement with the provided itemId does not exist. |
400 | validation-failure | Validation of the advertisement failed. There should be more information in the field errors |
Examples¶
Creating a new transaction:
Request :
POST /v1/advertisements/{itemId}/transactions HTTP/1.1 Host: api.marktplaats.nl Content-Type: application/json { "buyerId": 6789, "amount": 1200, "shippingCosts": 100 }Response :
HTTP/1.1 201 Created Content-Type: application/json { "_links":{ "self":{ "href":"/v1/advertisements/m123/transactions/2" } }, "transactionId": 2, "buyerId": 6789, "amount": 1200, "shippingCosts": 100, "status": "CREATED" }
Getting all transactions for an advertisement :
Request :
GET /v1/advertisements/m1/transactions HTTP/1.1 Host: api.marktplaats.nlResponse :
HTTP/1.1 200 OK Content-Type: application/json { "_links": { "self": { "href": "/v1/advertisements/m1/transactions" }, "curies": [ { "name": "mp", "href": "https://api.marktplaats.nl/docs/v1/{rel}.html", "templated": true } ] }, "_embedded": { "mp:advertisement-transaction": [ { "_links": { "self": { "href": "/v1/advertisements/m1/transactions/105" } }, "transactionId": 105, "buyerId": 6789, "amount": 1200, "shippingCosts": 100, "status": "COMPLETED" }, { "_links": { "self": { "href": "/v1/advertisements/m1/transactions/101" } }, "transactionId": 101, "buyerId": 3587, "amount": 1200, "shippingCosts": 100, "status": "CANCELLED" } ] } }