Event Schema
All events follow the CloudEvent spec and the JSON Event Format.
{
"specversion": "1.0",
"type": "so.slope.customer.created",
"source": "https://api.slope.so/v3/customers",
"subject": "cust_29b9nYY3UDuU4Et564Oii5mzJof",
"id": "ev_29b9X1tg7KdBNQOU0U9Ld0ARcb4",
"time": "2021-04-05T17:31:00Z",
"merchant": "mch_29b9X1tg7KdBNQOU0U9Ld0ARcb4",
"datacontenttype": "application/json",
"data": {
"id": "cust_29b9nYY3UDuU4Et564Oii5mzJof",
"email": "[email protected]"
}
}
Key | Type | Description |
---|---|---|
specversion | string | The CloudEvent spec version of the event. |
type | string | The type of event that occurred. |
source | string, URI-Reference | The context in which the event occurred, usually the API endpoint that produced the event. |
subject | string | The subject of the event found in the data attribute. |
id | string | The unique identifier of the event. |
time | string, RFC3339 | The time of occurrence. |
merchant | string | The merchant of the event. |
datacontenttype | string | The content type of the data attribute. application/json is the only possible value today but other content types may be introduced in the future. Always verify the value before consuming the data attribute. |
data | JSON | The event payload, usually a Slope object such as a Customer or Order. The value type may change depending on the datacontenttype . |
These are configurable via your Merchant Dashboard.
Customer Related Webhook Events
Prescreen Ready Event
Event Type: so.slope.prescreen.ready
Triggered when a prescreen has succeeded and the result is ready.
Data Schema
The data schema follows the same response schema as the Prescreen API.
{
"id": "string",
"customerId": "string",
"status": "string",
"approvalLikelihood": "string",
"limitCents": "number",
"bestAprPct": "number",
"reasons": "array",
"expiresAt": "string",
"metadata": "object"
}
Customer Created Event
Event Type: so.slope.customer.created
Triggered when a new customer is created in the system.
Data Schema
{
"customerId": "string",
"preApprovedAmount": "number",
"eligible": "boolean",
"currency": "string",
"externalId": "string",
"metadata": "object" // Metadata that was passed in when creating the Customer, or Prescreen.
}
Customer Updated Event
Event Type: so.slope.customer.updated
Triggered when a customer's information is updated.
Data Schema
{
"customerId": "string",
"preApprovedAmount": "number",
"eligible": "boolean",
"currency": "string",
"externalId": "string",
"metadata": "object" // Metadata that was passed in when creating the Customer, or Prescreen.
}
Customer Authorized Event
Event Type: so.slope.customer.authorized
Triggered when a new customer has accessed the Slope widget and authorizes merchant linking. The short lived authorization code expires after 10m, as denoted by the expiresAt
field. The authorization code should be traded for a long-lived access token using the /v4/auth/token
endpoint.
Data Schema
{
"customerId": "string",
"externalId": "string",
"authorizationCode": "string",
"expiresAt": "string",
"metadata": "object" // Metadata that was passed in when creating the Customer, or Prescreen.
}
Customer Authorization Revoked Event
Event Type: so.slope.customer.authorization_revoked
Triggered when a customer closes their account with Slope, unauthorizing merchant access.
Data Schema
{
"customerId": "string",
"externalId": "string",
"revokedAt": "string",
"metadata": "object"
}
Customer Application Submitted
Event Type: so.slope.customer.application_submitted
Triggered when a customer submits the application to Slope.
Data Schema
{
"customerId": "string",
"preApprovedAmount": "number",
"eligible": "boolean",
"currency": "string",
"externalId": "string"
}
Customer Credit Decision Reached Event
Event Type: so.slope.customer.credit_decision_reached
Triggered when a customer reaches an 'approved' or 'rejected'' state. A customer.updated event is a superset of this event and will fire every time this event fires.
Data Schema
{
"customerId": "string",
"preApprovedAmount": "number",
"eligible": "boolean",
"currency": "string",
"externalId": "string",
"metadata": "object" // Metadata that was passed in when creating the Customer, or Prescreen.
}
Order Related Webhook Events
Order Opened Event
Event Type: so.slope.order.opened
Triggered when an order is opened.
Data Schema
{
"id": "string", // unique ID
"externalId": "string", // corresponding external ID, if exists
"number": "string", // shortened 8 digit unique ID
"currency": "string",
"total": "number", // total, in cents
"status": "string", // Order status. Expected to be "open"
"paymentStatus": "string" // Order's payment status. When the order.opened event is emitted, the payment status will be "open".
}
Order Finalizing Event
Event Type: so.slope.order.finalizing
Triggered when an order is finalized.
Data Schema
{
"id": "string", // unique ID
"externalId": "string", // corresponding external ID, if exists
"number": "string", // shortened 8 digit unique ID
"currency": "string",
"total": "number", // total, in cents
"status": "string", // Order status. Expected to be "finalizing"
"paymentStatus": "string" // Order's payment status. When the order.finalized event is emitted, the payment status is expected to be "unpaid". It will transition between "partiallyPaid", and "complete" or "refund" as the order gets paid off.
}
Order Finalized Event
Event Type: so.slope.order.finalized
Triggered when an order is finalized.
Data Schema
{
"id": "string", // unique ID
"externalId": "string", // corresponding external ID, if exists
"number": "string", // shortened 8 digit unique ID
"currency": "string",
"total": "number", // total, in cents
"status": "string", // Order status. Expected to be "finalized"
"paymentStatus": "string" // Order's payment status. When the order.finalized event is emitted, the payment status is expected to be "unpaid". It will transition between "partiallyPaid", and "complete" or "refund" as the order gets paid off.
}
Order Adjustment Created Event
Event Type: so.slope.order.adjustment.created
Triggered when an adjustment for an order is created.
Data Schema
{
"type": "string", // expect "merchant_refund"
"externalOrderId": "string", // external ID for the order, if exists
"orderId": "string", // ID for the order
"externalOrderAdjustmentId": "string", // corresponding external ID for the refund, if exists
"orderAdjustmentId": "string", // ID for the order adjustment
"status": "string", // Adjustment status - expect "approved"
"amount" number, // The amount that was refunded, in cents. Negative indicates a refunded amount, e.g -10000 is a $100 refund.
}
Transaction Updated
Event Type: so.slope.transactions.updated
Triggered when a repayment happens on an order.
Data Schema
{
"id": "string", // Slope Unique Order ID
"externalId": "string", // Unique merchant generated external ID
"customerId": "string", // Slope Customer ID, null until order is claimed by customer
"number": "string", // Unique short & friendly order number
"checkoutCode": "string", // Unique code for Slope.JS widget
"checkoutUrl": "string", // Full URL for redirect flow
"total": "number", // Order total before customer fees, in cents
"merchantFee": "number", // Merchant fees, in cents
"customerFee": "number", // Customer fees, in cents
"totalWithFees": "number", // Order total with customer fees, in cents
"amountCanceledPrincipal": "number", // Amount canceled principal, in cents
"amountCanceledFee": "number", // Amount canceled fee, in cents
"amountRefundedPrincipal": "number", // Amount refunded principal, in cents
"amountRefundedFee": "number", // Amount refunded fee, in cents
"status": "string", // Current order status: pending, approved, submitted, opening, open, finalizing, finalized, unpaid, partiallyPaid, complete, defaulted, canceled, refunded, repayment
"finalizedAt": "string", // Time when order was finalized (ISO date-time), null if not finalized yet
"openedAt": "string", // Time when order was opened (ISO date-time), null if not open yet
"currency": "string", // Currency of the order: mxn, usd (from Currency enum, not AllCurrencies)
"selectedTermName": "string", // The selected payment term name, null if not selected yet
"selectedPaymentType": "string", // The selected payment method type: ach, card, oxxo, spei, wire, rtp, customer_wallet, virtual_card, virtual_account
"paymentSchedule": [
{
"amount": "number", // Amount due for this payment in cents
"date": "string" // Date the payment is due (YYYY-MM-DD)
}
],
"amountOutstanding": "number", // The amount outstanding for the order, 0 if fully paid, in cents
"paymentStatus": "string" // The payment status: unpaid, partiallyPaid, completed, refunded, opening, open, canceled
}
Updated 8 days ago