Jump to content

Webhook Events

Overview

Events is treddys way of letting you know when something happens in your integration. When an event occurs, we create a new Event object. If you registered a webhook endpoint to receive that event, we send it to your endpoint as part of a POST request.

Available Events

Deal Status

The deal status has been updated.

{
  "id": "e59ef90c-ad6a-11ed-afa1-0242ac120002",
  "event": "deal.status",
  "api_version": "v1",
  "created": 1671707297375,
  "data": {
    "dealId": "f4ca2694-81e7-11ed-a1eb-0242ac120002",
    "status": "Shipping_Pending",
    "statusDate": 1671707297375
  }
}

Available deal statuses:

  • Draft
    • The deal was created.
  • Ad
    • Seller has completed and signed the deal.
  • Signed
    • Buyer has signed on their end and can now go ahead and pay.
  • Cancelled
    • The deal has been cancelled.
  • Pickup_Pending
    • Deal has now been signed by both parties and payment has completed. The item can now be picked up manually.
  • Pickup_Expired
    • The item was not picked up and approved within the 7 day time period.
  • Pickup_Denied
    • The buyer did not approve the item and a manually dispute is initiated.
  • Shipping_Pending
    • Deal has now been signed by both parties and payment has completed. The item can now be shipped by the seller.
  • Shipping_Expired
    • The item was not picked up and approved within the 7 day time period
  • Shipping_In_Progress
    • The item is being shipped by the carrier.
  • Shipping_Arrived
    • The item has arrived to the buyer. The buyer has 24 hours to review or it will be automatically be approved.
  • Shipping_Returned
    • The item was not picked up and has returned to the seller.
  • Shipping_Review_Denied
    • The buyer did not approve the item and a manually dispute is initiated.
  • Refunded
    • We have refunded the payment.
  • Completed
    • The buyer has approved the item and the money will now be paid out to the seller. Payment status will change to “PendingPayOut” and then “PaidOut” once the seller registers their bank account for payout.

Signature Status

The signature status has been updated.

{
  "id": "808d1bdb-cb3a-44c3-af3d-e52d81ee274d",
  "event": "signature.status",
  "api_version": "v1",
  "created": 1671707297375,
  "data": {
    "dealId": "f4ca2694-81e7-11ed-a1eb-0242ac120002",
    "userId": "fc9c2750-81e7-11ed-a1eb-0242ac120002",
    "status": "Completed",
    "signatureType": "Seller",
    "signatureDate": 1671707264098
  }
}

Available signature statuses:

  • Initiated
  • Failed
  • Completed

Available signature types:

  • Seller
  • Buyer

Available signature types:

  • Seller
  • Buyer

Offer Created

The buyer sends an offer to the seller with their preffered price and method of shipping.

{
  "id": "808d1bdb-cb3a-44c3-af3d-e52d81ee274d",
  "event": "deal.offer",
  "api_version": "v1",
  "created": 1671707297375,
  "data": {
    "id": "f4ca2694-81e7-11ed-a1eb-0242ac120002",
    "dealId": "f4ca2694-81e7-11ed-a1eb-0242ac120002",
    "shippingType": "Schenker",
    "packageType": "Small",
    "buyerName": "Sven Svensson",
    "buyerEmail": "sven.svensson@gmail.com",
    "price": 850,
    "buyerRedirectUrl": "https://marknadsplats.se/ads/97c76862-d444-4a5d-a1de-781a6b7cc9cd",
    "sellerRedirectUrl": "https://marknadsplats.se/ads/97c76862-d444-4a5d-a1de-781a6b7cc9cd",
    "date": 1671707264098
  }
}

Available shipping types:

  • Schenker
  • Pickup

Available package types:

  • Small
  • Medium
  • Large
  • XL

Offer Approved

The seller has approved the buyer’s offer.

{
  "id": "808d1bdb-cb3a-44c3-af3d-e52d81ee274d",
  "event": "deal.offerApproved",
  "api_version": "v1",
  "created": 1671707297375,
  "data": {
    "id": "f4ca2694-81e7-11ed-a1eb-0242ac120002",
    "dealId": "f4ca2694-81e7-11ed-a1eb-0242ac120002",
    "date": 1671707264098
  }
}

Offer Denied

The seller has denied the buyer’s offer.

{
  "id": "808d1bdb-cb3a-44c3-af3d-e52d81ee274d",
  "event": "deal.offerDenied",
  "api_version": "v1",
  "created": 1671707297375,
  "data": {
    "id": "f4ca2694-81e7-11ed-a1eb-0242ac120002",
    "dealId": "f4ca2694-81e7-11ed-a1eb-0242ac120002",
    "date": 1671707264098
  }
}

Payment Status

The payment status has been updated.

{
  "id": "0a4f90f2-81e9-11ed-a1eb-0242ac120002",
  "event": "payment.status",
  "api_version": "v1",
  "created": 1671707297375,
  "data": {
    "dealId": "f4ca2694-81e7-11ed-a1eb-0242ac120002",
    "sellerUserId": "fc9c2750-81e7-11ed-a1eb-0242ac120002",
    "buyerUserId": "2d59d6fc-81e9-11ed-a1eb-0242ac120002",
    "status": "Paid",
    "amount": "1000",
    "fee": "50",
    "currency": "SEK"
  }
}

Available payment statuses:

  • Created
    • The payment was initiated.
  • Processing
    • The payment is being processed by the provider.
  • PaymentFailed
    • The payment has failed to complete.
  • PaymentCancelled
    • The payment was cancelled.
  • Paid
    • The payment has completed successfully.
  • Refunded
    • The payment has been refunded.
  • PendingPayOut
    • Payout has been queued, awaiting seller to register payout account.
  • PaidOut
    • Seller will be paid out within 5 bank days.
  • PayoutFailed
    • The payout failed to complete.
  • PayoutCancelled
    • The payout has been cancelled.

The fee is subtracted from the total amount. The above example means that the buyer has paid 1000 SEK and the seller will be paid out 950 SEK.

Simulating Webhook Events

While using the sandbox environment you are able to simulate the following webhook events

Examples

For testing and faking webhooks during development, we recommend using Webhookthing.