The event object

Events are our way of letting you know when something interesting happens in your account. 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.

Attributes

idstring
Unique identifier for the object
objectstring, value is "event"
A string representing the object’s type. Objects of the same type share the same value.
createdAttimestamp
The moment at which the object was created. Measured in milliseconds since the Unix epoch.
testboolean
A flag with a value false if the object exists in live mode or true if the object exists in test mode.
eventDatahash

The information related to this event.

typestring
The type of the event, see Supported event types.
versionstring
The version of the event.
datahash
The original object this event relates to. The shape of this depends on the object returned. For example in case of order related events this will be an order object.

Supported event types

Smartpay allows you to subscribe to the following events. You can subscribe to all or choose a subset of events you would like to be notified about.

ObjectEventEvent Type
Order The order was authorizedorder.authorized
The order was rejected. If the event is rejected because of a soft decline, the consumer will have the possibility to update his payment method and retry. In that case, the order will have a status of requires_authorization. If the event is rejected because of a hard decline, not further action can be taken and the order have a status of rejected.order.rejected
The order was canceledorder.canceled
Payment (Capture)New payment created (order captured)payment.created
RefundNew refund created (payment refunded)refund.created
Token The token was createdtoken.created
The token was approved by the usertoken.approved
The token was deletedtoken.deleted
The token was disabledtoken.disabled
The token was enabledtoken.enabled
The token was used to create an ordertoken.used
PayoutPayout calculation donepayout.generated
The payout was paid to your bank accountpayout.paid
CouponNew coupon createdcoupon.created
Coupon updatedcoupon.updated
Promotion CodeNew promotion code createdpromotion_code.created
Promotion code updatedpromotion_code.updated
Merchant userNew user created for your accountmerchant_user.created
User updated their passwordmerchant_user.password_reset

Sample events

{
  "id": "evt_test_yETRfprzCxFsSJaJZPIENt",
  "object": "event",
  "createdAt": 1664522079584,
  "test": true,
  "eventData": {
    "type": "order.authorized",
    "version": "2022-02-18",
    "data": {
      "id": "order_test_bA1znhGULw5lROfDTpHChv",
      "object": "order",
      "amount": 1500,
      "createdAt": 1642474233959,
      "currency": "JPY",
      "discountAmount": 100,
      "discounts": ["discount_test_zoA8epgqnvc7sbA4DmtHi3"],
      "expiresAt": 1642496117767,
      "lineItems": ["li_test_Lj1ofPS7HabmT3i0XsyB4V"],
      "metadata": {},
      "payments": ["payment_test_Gy2WUjw7mgrHWNj0toWP3H"],
      "reference": "my_reference",
      "shippingInfo": {
        "address": {
          "line1": "虎ノ門1-17-1",
          "line2": "虎ノ門ヒルズビジネスタワー 15階",
          "line3": "string",
          "line4": "string",
          "line5": "string",
          "subLocality": "string",
          "locality": "港区",
          "administrativeArea": "東京都",
          "postalCode": "105-6415",
          "country": "JP"
        },
        "addressType": "home",
        "carrierName": "yamato",
        "reference": "1234-5678-9123",
        "feeAmount": 500,
        "feeCurrency": "JPY"
      },
      "status": "succeeded",
      "test": true,
      "updatedAt": 1642534233959
    }
  }
}
{
  "id": "evt_test_D2mJ1ZtjNEzrzRR22mDylX",
  "object": "event",
  "createdAt": 1664522079617,
  "test": true,
  "eventData": {
    "type": "payment.created",
    "version": "2022-02-18",
    "data": {
      "id": "payment_test_Gy2WUjw7mgrHWNj0toWP3H",
      "object": "payment",
      "amount": 0,
      "createdAt": 1642474233959,
      "currency": "JPY",
      "description": "string",
      "lineItems": ["li_test_Lj1ofPS7HabmT3i0XsyB4V"],
      "metadata": {},
      "order": "order_test_bA1znhGULw5lROfDTpHChv",
      "reference": "string",
      "status": "processed",
      "test": true,
      "updatedAt": 1642534233959
    }
  }
}
{
  "id": "evt_test_lwqA1w7vyWXOJ0ImoVHiWL",
  "object": "event",
  "createdAt": 1664522180654,
  "test": true,
  "eventData": {
    "type": "refund.created",
    "version": "2022-02-18",
    "data": {
      "id": "refund_test_483xwWmZ1bE0GNvZBoek3h",
      "object": "refund",
      "amount": 1,
      "createdAt": 1642474233959,
      "currency": "JPY",
      "description": "Refund for smartpay order",
      "lineItems": ["li_test_Lj1ofPS7HabmT3i0XsyB4V"],
      "metadata": {},
      "payment": "payment_test_Gy2WUjw7mgrHWNj0toWP3H",
      "reason": "requested_by_customer",
      "reference": "my_refund_reference",
      "status": "succeeded",
      "test": true,
      "updatedAt": 1642534233959
    }
  }
}
{
  "id": "evt_test_yETRfprzCxFsSJaJZPIENt",
  "object": "event",
  "createdAt": 1642534233959,
  "test": true,
  "eventData": {
    "type": "token.approved",
    "version": "2022-02-18",
    "data": {
      "id": "paytok_test_zAo001ZRfyjz1F4rMyYPnL",
      "object": "token",
      "createdAt": 1642474233959,
      "metadata": {},
      "reference": "my_token_reference",
      "status": "active",
      "test": true,
      "updatedAt": 1642534233959
    }
  }
}