Skip to main content

Events

Black records an event for each change in an environment. Each event has a type that names what happened, in the form resource.action.

Find an event type​

The table lists every event type. A type's description says what the change was and what data.object holds.

  • About. What the event belongs to: the environment as a whole, one customer, or one subscription.
  • Facts. The extra values the event carries beside the object, such as the reason a webhook endpoint was switched off. A type with no facts carries none.
TypeSummaryDescriptionAboutFacts
api_client.revokedAPI client revokedAn API client was revoked for good: neither its secret nor a previous one obtains an access token any more, and every token issued to it is refused from the next request. data.object is the API client as it is now, with revoked true; no part of a secret is ever in it.environmentNone
api_client.secret_rolledAPI client secret rolledAn API client's secret was replaced with a new one, shown only in the answer to the roll; the old secret still obtains access tokens for the period the roll set, up to 7 days, or stopped at once. data.object is the API client as it is now; no part of either secret is ever in it.environmentNone
app.archivedApp archivedAn app was archived for good, and data.object is the app with archived_at set.environmentNone
app.createdApp registeredA website or mobile app was registered in the environment, and data.object is the new app.environmentNone
app.updatedApp changedAn app's name or allowed origins were changed, and data.object is the app as it is now, with the fields that changed and their earlier values in data.previous_attributes.environmentNone
checkout.session.completedCheckout session paidA checkout session was paid by Black's own record of the payment, never by the page's word, and its subscription is active; data.object is the checkout session with status complete, its customer and its subscription, and data.previous_attributes.status the status it had. Give access on this event or on a read of the session, never on a visit to the success address alone.subscriptionNone
checkout.session.expiredCheckout session expiredA checkout session expired 24 hours after it was created, unpaid, open or with its last payment declined, and its page no longer takes a payment; data.object is the checkout session with status expired, and data.previous_attributes.status the status it had.environmentNone
customer.blockedCustomer blockedA customer was blocked, with the reason in data.reason; each subscription still running ends at once with the reason blocked, and the customer cannot subscribe or pay until unblocked. data.object is the customer as it is now.customerreason
customer.createdCustomer createdA customer was created, and data.object is the new customer.customerNone
customer.deletedCustomer deletedA customer was deleted for good, and data.object is the customer as it was just before.customerNone
customer.flaggedCustomer flagged for reviewA customer was flagged for review, with the reason in data.reason; data.object is the customer as it is now, with its flag.customerreason
customer.subscription.createdSubscription createdA subscription was created, and data.object is the new subscription with its items and its latest invoice.subscriptionNone
customer.subscription.deletedSubscription endedA subscription ended, for example at the end of its grace period with its renewal invoice still unpaid, and data.object is the subscription after the change, with when and why it ended in canceled_at and cancellation_reason, and the fields that changed and their earlier values in data.previous_attributes.subscriptionNone
customer.subscription.grantedSubscription granted free for one termA subscription was granted for free for one term of its plan by the account's vendor, the actor of the event; it is active at once with no invoice, never renews, and ends at the end of the term, in data.ends_at, with the reason grant_ended. data.object is the subscription as it is now, and customer.subscription.created was recorded just before.subscriptionends_at
customer.subscription.renewal_upcomingSubscription renewal coming upA subscription will renew, at the lead time the account set before its renewal, and data.renewal says when, for which period, for how much and at which price for each item, the new price where a change takes effect then, and for a member paying in another currency what the renewal will bill in it, at which exchange rate, set, source and time, and where Black charges the card it will be charged to, with its brand and last 4; data.object is the subscription as it is now.subscriptionrenewal
customer.subscription.updatedSubscription changedA subscription was changed, by the billing engine (for example renewed or expired), by the account's own request (its metadata), or by the account's renewals being stopped or started again (whether it renews), and data.object is the subscription as it is now, with the fields that changed and their earlier values in data.previous_attributes; when a payment or a renewal made the change, data.invoice gives that invoice's ID, billing reason, currency, subtotal, total, period and, when it is taxed, its tax and its total excluding tax; for an invoice in the member's currency, also its presentment as the invoice shows it and its lines, each with its amount, rate and set in that currency.subscriptioninvoice
customer.unblockedCustomer's block removedA customer's block was removed, with the reason in data.reason; the customer may subscribe again as new. data.previous_attributes.block is the block it had.customerreason
customer.unflaggedCustomer's flag removedA customer's flag was removed, with the reason in data.reason; data.object is the customer as it is now, and data.previous_attributes.flag the flag it had.customerreason
customer.updatedCustomer changedA customer was changed, and data.object is the customer as it is now, with the fields that changed and their earlier values in data.previous_attributes.customerNone
customer_identity.ambiguousSign-in email held by several customersA sign-in arrived with a proved email that several customers of the environment each hold proved, so it was linked to none of them: a new customer was made for it, and data.ambiguity.customers lists the customers who hold the email. data.object is the new identity.customerambiguity
customer_identity.linkedWay of signing in linked to a customerA way of signing in with Black's own sign-in was linked to a customer: an email the customer signed up with, or a sign-in matched to them. data.object is the identity: its customer, its provider, its subject, its email and whether that email is proved. It never holds a password, a hash or a token.customerNone
customer_identity.removedWay of signing in removed from a customerThe account removed one of a customer's identities, so that way of signing in no longer signs the customer in; sessions it made live on. data.object is the identity as it was just before.customerNone
customer_identity.verifiedSign-in email proved by its customerA customer proved the email of one of their identities for the first time, by the link Black emailed them at sign-up or by completing a reset of their password. It is told once for an identity, and not again when the email is proved again. data.object is the identity after, with email_verified true and verified_at set. It never holds a password, a hash or a token.customerNone
customer_session.createdCustomer signed inA customer signed in to one of the environment's apps and a session began, and data.object is the new session: its customer, its app, how the customer signed in and when it ends. It never holds a token.customerNone
customer_session.endedCustomer's session ended earlyA customer's session ended before its time, and data.reason says why: the customer signed out everywhere, the account ended the customer's sessions, a refresh token was used a second time, the customer was blocked or deleted, the password was reset or changed, or the account was secured because the owner of its email signed in by a way that proves it while the password was not proved theirs. data.object is the session as it is now, with ended_at set; every token of it is refused from then on.customerreason
customer_session.reused_refresh_tokenRefresh token used again, so the session endedA refresh token of a customer's session was used again after its first use had been answered, outside the few seconds in which a repeat is answered the same pair, so the whole session ends at once and customer_session.ended follows with the reason refresh_token_reused. data.object is the session as it was just before; it never holds a token.customerNone
customer_session.token_createdSign-in token made for a customerThe account's server made a sign-in token for a customer, which a page exchanges once for the customer's session; the event's actor is the caller that made it, and data.object is the customer. It never holds the token.customerNone
declines.threshold_reachedMany card payments and saves declined in a short timePayments on the environment's hosted checkout pages and cards its customers saved in its apps were declined data.threshold times within data.within_seconds seconds, which can mean someone is trying stolen cards; it is sent once each time the count is reached, data.checkout_payments and data.card_saves say how many of those declines were of each kind, and data.object is the environment's settings as they are now.environmentthreshold, within_seconds, checkout_payments, card_saves
dispute.createdPayment disputed by the customerA customer disputed a payment of an invoice with their bank, told by the gateway where Black charged the invoice or reported by the account where it collected the money itself, and data.object is the dispute. The membership the invoice belongs to ends at once with the reason chargeback, and the customer is flagged with the reason chargeback, unless already flagged; a payment reported later does not bring the membership back.subscriptionNone
dispute.updatedA dispute's status or details changedA dispute's status or details changed: it moved to a later state, won, lost, canceled, expired, resolved or accepted, or the gateway gave its category, its reason code or the date its evidence is due. data.object is the dispute as it is now, with the fields that changed and their earlier values in data.previous_attributes. Nothing else changes: a membership the dispute ended stays ended, and the customer's flag stays.subscriptionNone
entitlements.active_entitlement_summary.updatedCustomer's entitlements changedThe features a customer is entitled to changed, for example when a subscription became active, renewed with a feature attached or detached, entered or ended its grace, or the customer was deleted, and data.object is the customer's active entitlements after the change, the first 10 with has_more and the url where all are read, with the list before the change in data.previous_attributes.entitlements.customerNone
feature.createdFeature createdA feature was created, and data.object is the new feature.environmentNone
feature.updatedFeature changedA feature was changed, for example its metadata or whether it is active, and data.object is the feature as it is now, with the fields that changed and their earlier values in data.previous_attributes; data.affected_customers is how many customers of the environment, not deleted, holding a live subscription (incomplete, active or past_due) with an item on a price of a product the feature is attached to.environmentaffected_customers
gateway_connection.createdPayment gateway connectedA payment gateway was connected to the environment with the account's own credentials, which the gateway accepted, and data.object is the new connection, with the address Black registered for the gateway's notifications; no part of a secret is ever in it.environmentNone
gateway_connection.disconnectedPayment gateway disconnectedA gateway connection was disconnected: its credentials and signing key were deleted, and the environment's payment mode went back to the account collecting the money itself. data.object is the connection as it is now, with status disconnected.environmentNone
gateway_connection.updatedGateway connection changedA gateway connection changed: its credentials were replaced with new ones the gateway accepted, or the gateway refused the stored ones, so its status is failing, or a call succeeded again, so its status is active. data.object is the connection as it is now, with the fields that changed and their earlier values in data.previous_attributes; no part of a secret is ever in it.environmentNone
invoice.createdInvoice createdAn invoice was created for a subscription, and data.object is the new invoice with its lines.subscriptionNone
invoice.finalizedInvoice finalised and ready to collectAn invoice was finalized and can now be collected, and data.object is the invoice with its amounts and due date.subscriptionNone
invoice.overdueInvoice overdueAn invoice reached its due date without being paid, and data.object is the invoice as it is now.subscriptionNone
invoice.paidInvoice paidAn invoice was paid, collected by Black through the account's gateway or reported by the account, which collected the money itself, and data.object is the invoice as it is now, with when it was paid, its payment reference (the gateway's payment where Black collected it) and the account's note.subscriptionNone
invoice.payment_action_requiredInvoice payment needs the customerA payment Black took for an invoice needs the customer: the card asked them to authenticate, and the subscription's next_action gives the address to send them to, or the card cannot be charged while they are away, and they pay the invoice again themselves. data.object is the invoice as it is now.subscriptionNone
invoice.payment_failedInvoice payment failedA payment Black took for an invoice failed, and data.object is the invoice as it is now, with the attempts made, the retries left, when the next is due, the reason the last one failed and the card it was charged to.subscriptionNone
invoice.payment_information_requestedCard holder's bank asked about an invoice paymentThe card holder's bank asked, through the gateway, for information about a payment Black took for an invoice, before or instead of disputing it; no money is taken, no dispute is opened, the membership does not change and the customer is not flagged. data.object is the invoice as it is now, data.gateway_payment names the payment and data.gateway_request the gateway's ID of the request, and, where the gateway names them, data.category and data.reason_code say why the bank asks and data.respond_by, in Unix seconds, when it is to be answered by. Answer it at the gateway; a request left unanswered may become a dispute.subscriptiongateway_payment, gateway_request, category, reason_code, respond_by
invoice.payment_outcome_unknownInvoice payment held, its outcome unknownA payment Black sent for an invoice may have been taken, but Black cannot learn its outcome: the gateway account it went through is no longer the one the gateway connection reaches, because the connection's credentials were replaced under another client or the gateway was connected anew. Black neither sends it again nor reads it through the new account, and does not fail it; it is held, the invoice stays as it is, and no retry is made while it is held. data.object is the invoice as it is now, data.attempt names the attempt, which is the reference of its payment at the gateway, data.amount and data.currency say what it was for, and data.connection names the connection it went through. Look the payment up by data.attempt in that gateway account, then report what it shows with POST /v1/invoices/{invoice}/payment-outcome: taken, with its payment ID, pays the invoice, and not taken fails the attempt so the invoice can be paid or retried.subscriptionattempt, amount, currency, connection
invoice.payment_unappliedPayment taken that could not be applied to the invoiceBlack took a payment through the gateway that it could not apply to the invoice, because the invoice or the customer changed while the money was being taken, or the payment's reference is already on another invoice (data.reason payment_reference_in_use), or the payment is set aside for our team (data.reason command_set_aside), or because the gateway took a second payment for the same attempt (data.reason paid_twice), or a checkout's payment came after its subscription had ended, so the checkout was not completed (data.reason subscription_ended), or Black kept trying to process the gateway's notice of the payment for about eight hours and gave up (data.reason unprocessed: the payment will not be applied to the invoice, so refund it); data.object is the invoice, data.reason says why, data.gateway_payment names the payment and, for the first invoice of a subscription a checkout session made, data.checkout_session names that session, so the account can refund it. Black refunds nothing by itself.subscriptionreason, gateway_payment, checkout_session
invoice.refund_outcome_unknownInvoice refund held, its outcome unknownA refund Black asked the gateway for may have been given back, but Black cannot learn its outcome, and it stays pending, held, never failed on a guess. data.reason says why: connection_changed when the invoice's payment went through another gateway connection or Checkout.com client than the one now active, so Black asks the new one nothing, or key_window_passed when the gateway did not answer clearly within the 48 hours it keeps the refund's key, so Black asks it nothing again. data.object is the invoice as it is now, data.refund names the refund, which is the reference of the refund at the gateway, and data.amount and data.currency say what it was for. Look the refund up by data.refund in the gateway account that took the payment. It is sent once for each refund.subscriptionrefund, amount, currency, reason
invoice.voidedInvoice voidedAn invoice was voided and is no longer owed, and data.object is the invoice with the time it was voided.subscriptionNone
payment_method.attachedCard saved for a customerA card was saved for a customer from the single-use token the gateway's own fields made, and data.object is the new payment method, active, with its brand, last 4 digits and expiry; it holds no card number or security code.customerNone
payment_method.detachedCustomer's card removedA customer's card was removed at the gateway and can no longer be charged, and data.object is the payment method with status detached; a customer whose default it was has no default until a card is saved or chosen.customerNone
payment_method.updatedCustomer's default card changedA customer's default card changed, to a newly saved card or to another of their cards, and every later charge uses it; data.object is the payment method that is now the default.customerNone
price.createdPrice createdA price was created on a product, and data.object is the new price.environmentNone
price.updatedPrice changedA price was changed, for example archived or its lookup key moved to another price, and data.object is the price as it is now, with the fields that changed and their earlier values in data.previous_attributes; data.affected_customers is how many customers of the environment, not deleted, holding a live subscription (incomplete, active or past_due) with an item on the price.environmentaffected_customers
price_move.createdPrice move of subscriptions startedThe account asked to move the subscriptions on one price to another; data.object holds both prices, the notice period, and how many subscriptions it reaches. Each subscription then records customer.subscription.updated when its move is set.environmentNone
product.createdProduct createdA product was created, and data.object is the new product.environmentNone
product.deletedProduct deletedA product was deleted for good, and data.object is the product as it was just before.environmentNone
product.updatedProduct changedA product was changed, and data.object is the product as it is now, with the fields that changed and their earlier values in data.previous_attributes; data.affected_customers is how many customers of the environment, not deleted, holding a live subscription (incomplete, active or past_due) with an item on a price of the product.environmentaffected_customers
product_feature.attachedFeature attached to a productA feature was attached to a product, and data.object is the attachment, with the feature as it is now; data.affected_customers is how many customers of the environment, not deleted, holding a live subscription (incomplete, active or past_due) with an item on a price of the product.environmentaffected_customers
product_feature.detachedFeature detached from a productA feature was detached from a product, and data.object is the attachment as it was just before; data.affected_customers is how many customers of the environment, not deleted, holding a live subscription (incomplete, active or past_due) with an item on a price of the product.environmentaffected_customers
refund.createdRefund asked for or recordedA refund of an invoice's payment was asked for, and data.object is the refund: where Black charged the invoice, Black asked the gateway to give the money back to the card, and the refund is pending until the gateway answers for good, or failed when the gateway refused it at once, with the reason in failure_reason; where the account collected the money itself, or refunded it at the former gateway client the payment went through, the refund it made is recorded, succeeded at once, with that client's action in gateway_action for the latter. The membership, its status and its benefits do not change.subscriptionNone
refund.updatedRefund succeeded or failedA refund the gateway was asked for reached its final word, from the gateway or, for a refund held across a change of client, as the account reported it from the former client, made by the actor who reported it; data.object is the refund as it is now: succeeded, the money given back, so the invoice's amount_refunded rose, or failed, with the gateway's reason in failure_reason; data.previous_attributes.status is the status it had.subscriptionNone
settings.updatedAccount settings changedAn account's settings were changed, and data.object is the settings as they are now, with the fields that changed and their earlier values in data.previous_attributes; data.affected_customers is how many customers of the environment, not deleted, holding a live subscription (incomplete, active or past_due) the change reaches, which is every one of them.environmentaffected_customers
test_clock.advancingTest clock started advancingA test clock started to advance by request, and data.object is the test clock with status advancing, its frozen_time still the time it had and advancing_to the time it moves to.environmentNone
test_clock.createdTest clock createdA test clock was created in a test environment, and data.object is the new test clock.environmentNone
test_clock.deletedTest clock deletedA test clock was deleted for good with its customers and their subscriptions, by request or 30 days after its creation, and data.object is the test clock as it was just before.environmentNone
test_clock.internal_failureTest clock stopped advancing on a failureA test clock stopped advancing because work that fell due for one of its customers could not be run, and data.object is the test clock with status internal_failure, its frozen_time the time it had before; it can still be read, renamed and deleted.environmentNone
test_clock.readyTest clock finished advancingA test clock finished advancing: everything that fell due for its customers up to advancing_to has run, and data.object is the test clock with status ready and frozen_time the new time.environmentNone
test_clock.updatedTest clock renamedA test clock was renamed, and data.object is the test clock as it is now, with its earlier name in data.previous_attributes.environmentNone
webhook_endpoint.disabledWebhook endpoint switched off after failed deliveriesA webhook endpoint was switched off because every delivery to it kept failing, as data.reason says, and it receives no events until it is enabled again.environmentreason

Branch on type in your own code, and ignore a type you do not handle. To receive events at an address of yours, see Webhooks.

Read the fields every event carries​

An event is one JSON object. Its fields come in this order, and each is present in every event, with the value null where it does not apply.

FieldHolds
objectevent.
idThe ID of the event, which starts with evt_.
typeThe event type, in the form resource.action.
api_versionThe API version your account is pinned to.
livemodetrue in a live environment and false in a test environment.
createdWhen Black recorded the event, in Unix seconds.
actorWho made the change. See below.
customerThe ID of the customer the event is about.
customer_sequenceThe number of the event among that customer's events. See Put a customer's events in order.
subscriptionThe ID of the subscription, for an event about a subscription or one of its invoices.
subscription_statusThe status of that subscription as the change left it, such as active or past_due.
subscription_status_labelThe label of that subscription as the change left it, such as grace_period or pending_cancel.
pricesThe IDs of the prices of the subscription's items, in the order of the items, each price once.
dataThe change itself. See below.

An event about the environment as a whole, such as a product, a price or the settings, has null in customer, customer_sequence, subscription, subscription_status, subscription_status_label and prices. An event about a customer, such as customer.flagged, has the customer and its number and null in the four fields of a subscription. An event about a subscription or one of its invoices has all six. Every event of one change carries the same subscription_status, so the invoice events of a payment and the subscription update that follows them agree.

actor is an object with a type and an id. These are the types, and what each id is:

TypeWhoThe id
api_clientA client of your account made the change.The ID of the client.
appAn app of your environment made the change, for what an account's own sign-in does through it before the customer exists.The ID of the app.
checkout_sessionThe hosted checkout page of a checkout session made the change, for what a customer does on it.The ID of the checkout session.
customerA customer made the change for themselves, through their own session.The ID of the customer.
operatorA person at Black made the change.Always null.
systemBlack's own scheduled work made the change, such as a renewal or the end of grace.Always null.
team_memberA person on your account's team made the change.The ID of the person, which starts with usr_.
vendor_clientA client of your vendor made the change, acting for your account.The ID of the client.
vendor_team_memberA person on your vendor's team made the change, acting in your account.The ID of the person, which starts with usr_.
  • team_member is a person on your account's team, and id is the person's ID, never a name or an email.
  • vendor_team_member is a person on your vendor's team, acting in your account, and id is the person's ID.
  • checkout_session is a customer paying on a checkout page, and id is the checkout session's ID.
  • customer is a customer acting for themselves, such as signing in, and id is the customer's ID.
  • app is one of your apps, acting before the customer exists, such as when an identity token makes the customer, and id is the app's ID.

data holds three things. data.object is the object the event is about, as it is after the change. data.previous_attributes holds the old value of each field that the change altered, and is null for an event that creates or records something rather than updates it. The facts of the type sit beside them in data, such as data.reason of customer.flagged or data.affected_customers of price.updated. The Facts column of the table names them.

Put a customer's events in order​

customer_sequence counts one customer's events from 1, in the order Black recorded them. A number is never skipped and never used twice. An event about the environment as a whole carries no number.

Black does not deliver events in order, so order a customer's events by customer_sequence, not by the order they arrive in.

A gap in the numbers that your endpoint receives has one of two causes. The missing event is of a type that your endpoint does not receive, or it is not delivered yet. To fill the gap, list the customer's events with GET /v1/events?customer={id}. The list shows an event for 30 days after it was created, newest first.

The sample creates a customer, a subscription and the report of its payment, and then lists the customer's events. The oldest event, customer.created, carries customer_sequence 1, and each later event carries the next number. It writes PLACEHOLDER_ACCESS_TOKEN where your access token goes, reads each ID from the response before it, and needs sed. A test environment takes five writes a second, so the sample waits a second between its writes.

TOKEN=PLACEHOLDER_ACCESS_TOKEN

CUSTOMER=$(curl --silent --request POST https://api.black.example/v1/customers \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/json" \
--data '{"name":"Noor","email":"noor@example.com","external_reference":"events-order-guest-7731"}' \
| sed -n 's/.*"id":"\(cus_[0-9a-z]*\)".*/\1/p')

PRODUCT=$(curl --silent --request POST https://api.black.example/v1/products \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/json" \
--data '{"name":"Events Monthly"}' \
| sed -n 's/.*"id":"\(prod_[0-9a-z]*\)".*/\1/p')

PRICE=$(curl --silent --request POST https://api.black.example/v1/prices \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/json" \
--data "{\"product\":\"$PRODUCT\",\"currency\":\"SAR\",\"unit_amount\":6000,\"recurring\":{\"interval\":\"month\",\"interval_count\":1}}" \
| sed -n 's/.*"id":"\(price_[0-9a-z]*\)".*/\1/p')

INVOICE=$(curl --silent --request POST https://api.black.example/v1/subscriptions \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: events-order-subscription-7731" \
--data "{\"customer\":\"$CUSTOMER\",\"items\":[{\"price\":\"$PRICE\"}]}" \
| sed -n 's/.*"latest_invoice":"\(in_[0-9a-z]*\)".*/\1/p')

curl --silent --request POST https://api.black.example/v1/invoices/$INVOICE/mark-paid \
--header "Authorization: Bearer $TOKEN" \
--header "Content-Type: application/json" \
--data '{"amount":6000,"currency":"SAR","payment_reference":"events-order-payment-7731"}'

curl --silent "https://api.black.example/v1/events?customer=$CUSTOMER" \
--header "Authorization: Bearer $TOKEN"

The subscription request answers 201, and the report and the list answer 200. The list holds customer.created, customer.subscription.created, the events of the first invoice and customer.subscription.updated, with customer_sequence running from 1 to the last event. To run the sample again in the same environment, change the external_reference, the Idempotency-Key and the payment_reference.

Know how many customers a change reaches​

A change to the catalogue or to the settings can reach many customers. price.updated, product.updated, feature.updated, product_feature.attached, product_feature.detached and settings.updated carry the fact data.affected_customers, a whole number. It counts the customers that are not deleted and that hold a live subscription the change reaches. A subscription is live when its status is incomplete, active or past_due.

  • price.updated counts the customers with an item on that price.
  • product.updated, product_feature.attached and product_feature.detached count the customers with an item on a price of that product.
  • feature.updated counts the customers with an item on a price of a product that the feature is attached to now.
  • settings.updated counts every customer that holds a live subscription. When the change turns renewals_stopped off, it counts also the customers whose subscription comes back.

The *.created events and product.deleted carry no count: nothing holds a new object, and a product with prices cannot be deleted.

Find the event for a business moment​

Black names an event by what changed, and a business names a moment by what happened. The table maps each business name that Black sends an event for to that event, and says what to read in it. Every event it names is in the table of types above.

Business nameEvent of BlackWhat to read in itPage
Subscribedcustomer.subscription.updateddata.previous_attributes.status is incomplete and data.object.status is active: the first invoice was reported paid. data.object.metadata holds the booking reference you gave when you created the subscription. The invoice data is in data.invoice: total is the gross, and under tax rules tax and total_excluding_tax are the tax and the net. For a customer with a currency of their own, data.invoice.presentment holds the amounts in that currency with the rate, its set and its time. The invoice.paid just before it holds the same in data.object.Create a subscription and report its payments, Show and charge in your customer's currency
Renewed, when the period rollscustomer.subscription.updatedactor.type is system. data.object.current_period_end is the end of the new period, and data.previous_attributes holds current_period_start, current_period_end and latest_invoice as they were. The renewal's invoice.created and invoice.finalized come just before it. The invoice data is in data.invoice: total is the gross, and under tax rules tax and total_excluding_tax are the tax and the net. For a customer with a currency of their own, data.invoice.presentment holds the amounts in that currency with the rate, its set and its time. The renewal's invoice.created and invoice.finalized hold the same in data.object.Create a subscription and report its payments, Show and charge in your customer's currency
Renewed, when its payment is reportedinvoice.paiddata.object.billing_reason is subscription_cycle for the invoice of a renewal, and subscription_create for the first invoice. When the invoice is paid before it is due, the subscription stays active and Black records no subscription update. With days_until_due at its default of 1, a renewal paid within the day records only this event; when it is unpaid at its due date, the renewal goes to Payment Failed, and its payment is Payment Recovered. When days_until_due is 0, the renewal invoice is overdue at once, so the renewal goes straight to Payment Failed. The invoice data is in data.object: total is the gross, and under tax rules tax and total_excluding_tax are the tax and the net. For a customer with a currency of their own, data.object.presentment holds the amounts in that currency with the rate, its set and its time.Create a subscription and report its payments
Payment Failedinvoice.overdue, then customer.subscription.updatedsubscription_status of the invoice event is past_due: an invoice that is overdue while the subscription is incomplete is the first invoice, not a failed renewal. In the update, data.object.status is past_due, data.object.status_label is grace_period, and data.object.grace_period_end says when grace ends. data.previous_attributes holds status, status_label, grace_period_end and grace_keeps_entitlements as they were. actor.type is system.Create a subscription and report its payments
Payment Recoveredinvoice.paid, then customer.subscription.updateddata.previous_attributes.status is past_due and data.object.status is active. data.previous_attributes also holds the grace fields as they were. The invoice data is in data.invoice of the update and in data.object of the invoice.paid before it: total is the gross, under tax rules tax and total_excluding_tax are the tax and the net, and presentment holds the amounts in the customer's own currency with the rate, its set and its time.Create a subscription and report its payments, Show and charge in your customer's currency
Expired, after grace, a cancel now, the end of a period set to cancel, a customer deleted or blocked, or stopped renewalscustomer.subscription.deleteddata.object.end_reason says how it ended: payment_failed, canceled_now, period_end, customer_deleted, customer_blocked or renewals_stopped. actor.type is api_client or vendor_client for a cancel now and system for the others.Cancel a subscription
Expired, an unpaid new subscriptioninvoice.voided, then customer.subscription.updatedThis is an update, not a deletion. data.object.status is incomplete_expired, data.object.end_reason is first_invoice_unpaid, and data.previous_attributes.status is incomplete. actor.type is system.Create a subscription and report its payments
Cancel Scheduledcustomer.subscription.updateddata.object.cancel_at_period_end is true and data.object.status_label is pending_cancel. data.object.cancellation_reason holds the reason given, or not_given.Cancel a subscription
Resumedcustomer.subscription.updatedThe undo of a pending cancel: data.object.cancel_at_period_end is false and data.previous_attributes.cancel_at_period_end is true.Cancel a subscription
Upgradedinvoice.paid, then customer.subscription.updatedThe report of an upgrade's offer. data.object.billing_reason of the invoice is subscription_update, and in the update data.previous_attributes.items holds the items as they were. The invoice data is in data.invoice of the update and in data.object of the invoice.paid before it: total is the gross, under tax rules tax and total_excluding_tax are the tax and the net, and presentment holds the amounts in the customer's own currency, each line with the rate of its own set.Change a customer's plan, Show and charge in your customer's currency
Renewal Upcomingcustomer.subscription.renewal_upcomingdata.renewal holds renews_at, period_end, amount, currency and items, each with its item, price, quantity, amount and price_changes. actor.type is system. For a customer with a currency of their own, data.renewal.presentment holds the amount and currency that the renewal charges, with the rate and its set, and each item its presentment_amount. Black records it the number of days before the renewal that the setting reminder_lead_days holds.Change account settings
Flaggedcustomer.flaggeddata.reason holds the reason, and data.previous_attributes.flag is null.Flag a customer and read the activity log
Unflaggedcustomer.unflaggeddata.reason holds the reason, and data.previous_attributes.flag holds the flag that was removed.Flag a customer and read the activity log
Blockedcustomer.blockeddata.reason holds the reason, and data.previous_attributes.block is null. Each live subscription of the customer then ends with a customer.subscription.deleted whose end_reason is customer_blocked.None
Unblockedcustomer.unblockeddata.reason holds the reason, and data.previous_attributes.block holds the block that was lifted.None
Price Changedprice.updateddata.previous_attributes holds the old value of each field that changed, data.affected_customers says how many customers it reaches, and actor says who changed it.None
Discount Changedfeature.updateddata.previous_attributes.metadata holds the old metadata of the feature, data.object.metadata the new one, and data.affected_customers how many customers it reaches.Check what a customer holds
Settings Changedsettings.updateddata.previous_attributes holds the old value of each setting that changed, data.affected_customers says how many customers hold a live subscription, and actor says who changed it.Change account settings

A business name that is not in the table is not an event that Black sends.

What a customer holds has its own event, entitlements.active_entitlement_summary.updated. It is not a business name: Black records it when the features a customer holds change, such as after a payment, an end or a block. Read what the customer holds with the lookup in Check what a customer holds.