Get started
Webhooks

organization.billing.payment_method

organization.billing.payment_method

Subscribe an endpoint to every event on this page with organization.billing.payment_method.*. Each is the envelope every webhook event shares, with the PaymentMethodEventObject object as its data.object.

Event typeWhat happened
organization.billing.payment_method.attachedA payment method was saved.
organization.billing.payment_method.updatedA payment method became, or stopped being, the default.
organization.billing.payment_method.detachedA payment method was removed.

The PaymentMethodEventObject object

A payment method as a webhook event carries it: its identifier and whether it is the one the organization is charged on. getOrganizationBillingPaymentMethods reads its details.

object

string

required

One of: organization.billing.payment_method

The kind of object this is, always organization.billing.payment_method: the family of the event types that carry it, and what tells the members of WebhookEventObject apart.

id

string

required

Identifier of the payment method, the payment provider's pm_ identifier. It is not a UUID.

organization_id

string (uuid)

required

Identifier of the organization the payment method belongs to.

is_default

boolean

required

Whether the organization is charged on it once this change was made.

organization.billing.payment_method.attached

A payment method was saved to the organization. It is recorded once for the payment method, whatever became of the request that saved it: one saved and not made the default, because the organization's Data API subscription could not be opened on it, is recorded too.

Triggered by

  • organization.billing.payment_method.attach: Once for each payment method saved, whether or not it becomes the one the organization is charged on: is_default says whether it was when the event was recorded.
    • POST /v1/organizations/{organization_id}/billing/payment-methods: postOrganizationBillingPaymentMethod, mountaya.admin.billing.postOrganizationBillingPaymentMethod() in TypeScript. Every payment method saved.
    • The payment provider: The payment provider reports a payment method confirmed, as a method that confirms after the request does.
    • A schedule: Every day, a check finds that the payment method the organization is charged on was saved without being recorded, and records it.

Payload

type

string

required

One of: organization.billing.payment_method.attached

Always organization.billing.payment_method.attached.

data.object

PaymentMethodEventObject

required

The payment method.

See the PaymentMethodEventObject object.

Every other field is the envelope every webhook event shares.

organization.billing.payment_method.updated

Which payment method the organization is charged on changed: one records it for the new default and one for the former.

Triggered by

  • organization.billing.payment_method.attach: When the payment method saved becomes the one the organization is charged on: once for it and once for the former default.
    • POST /v1/organizations/{organization_id}/billing/payment-methods: postOrganizationBillingPaymentMethod, mountaya.admin.billing.postOrganizationBillingPaymentMethod() in TypeScript. Every payment method saved.
    • The payment provider: The payment provider reports a payment method confirmed, as a method that confirms after the request does.
    • A schedule: Every day, a check finds that the payment method the organization is charged on was saved without being recorded, and records it.
  • organization.billing.payment_method.set_default: When the default changes: once for the new default and once for the former one.
    • POST /v1/organizations/{organization_id}/billing/payment-methods/{payment_method_id}/set-default: postOrganizationBillingPaymentMethodSetDefault, mountaya.admin.billing.postOrganizationBillingPaymentMethodSetDefault() in TypeScript. Every request.

Payload

type

string

required

One of: organization.billing.payment_method.updated

Always organization.billing.payment_method.updated.

data.object

PaymentMethodEventObject

required

The payment method.

See the PaymentMethodEventObject object.

data.previous_attributes

object

The former value of each field of data.object the change moved, and of no other.

Every other field is the envelope every webhook event shares.

organization.billing.payment_method.detached

A payment method was removed from the organization.

Triggered by

Payload

type

string

required

One of: organization.billing.payment_method.detached

Always organization.billing.payment_method.detached.

data.object

PaymentMethodEventObject

required

The payment method.

See the PaymentMethodEventObject object.

Every other field is the envelope every webhook event shares.