Advertisement transaction¶
A transaction is an instance of buying for an advertisement where the payment is not handled by Marktplaats but by a third-party (e.g. Media Medics). The third-party in this case will make sure that the purchase amount is received by the seller.
Note
Work in Progress
Fields¶
field | type | constraints | default | Req | W | U |
---|---|---|---|---|---|---|
transactionId | int | – | no | no | no | |
buyerId | int | – | yes | yes | no | |
amount | int | non negative | yes | yes | no | |
shippingCosts | int | non negative | yes | yes | no | |
status | string | – | no | no | no |
transactionId
The transaction id.
buyerId
The buyer id.
amount
The transaction amount.
shippingCosts
The shipping costs.
status
The status of the transaction.
Reference¶
GET /v1/advertisements/{itemId}/transactions/{transactionId}
Returns specific transaction on the advertisement.
Errors¶
http | error code | description |
---|---|---|
404 | transaction-not-found | The transaction doesn’t exist |
403 | unauthorized | The user does not own the advertisement or transaction |
Examples¶
Getting specific transaction for an advertisement :
Request :
GET /v1/advertisements/m1/transactions/2 HTTP/1.1 Host: api.marktplaats.nlResponse :
HTTP/1.1 200 OK Content-Type: application/json { "_links": { "self": { "href": "/v1/advertisements/m1/transactions/2" }, }, "transactionId": 2, "buyerId": 6789, "amount": 1200, "shippingCosts": 100, "status": "COMPLETED" }
Notification¶
Third-party can expect the following notification structure from Marktplaats for any transaction status changes:
POST /callback/url HTTP/1.1
Host: api.consumer.com
Content-Type: application/json
X-Ecg-Signature: b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad
{
"_links":{
"curies":[
{
"href": "https://api.marktplaats.nl/docs/v1/{rel}.html",
"templated": true,
"name": "mp"
}
]
},
"_embedded": {
"mp:advertisement-transaction": {
"_links": {
"self": {
"href": "/v1/advertisements/m123456789/transactions/123"
}
},
"transactionId": 123,
"buyerId": 6789,
"amount": 1200,
"shippingCosts": 100,
"status": "COMPLETED"
}
},
"eventType": "transactionStatusChanged",
"created": "2014-08-20T13:07:06Z",
"eventData": {
"transactionId": 123,
"oldStatus": "PENDING",
"newStatus": "COMPLETED"
}
}
The endpoint of the callback will for now be configured by Marktplaats until a future self-service implementation in the API becomes available.