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 . |
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"
}
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"
}
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"
}
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"
}
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",
"paymentStatus": "string"
}
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",
"paymentStatus": "string"
}
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 18 days ago