{"openapi":"3.0.3","info":{"title":"Digits Webhooks","description":"OpenAPI schema for HTTP requests Digits sends to customer webhook endpoints. The server and path are illustrative; configure your own webhook URL in Digits.","version":"1.0"},"servers":[{"url":"https://example.com","description":"Your webhook endpoint host"}],"paths":{"/webhooks/digits":{"post":{"tags":["WebhookEvents"],"summary":"Receive Webhook Event","description":"Digits sends this JSON request body to your configured webhook endpoint. Return any 2xx response to acknowledge receipt; the response body is ignored.","operationId":"receiveWebhookEvent","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}},"required":true},"responses":{"200":{"description":"OK","content":{}},"default":{"description":"Default error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"}}}}}}}},"components":{"schemas":{"ActingUser":{"required":["userId"],"type":"object","properties":{"userId":{"type":"string"}}},"BillApprovedEvent":{"required":["billId","status"],"type":"object","properties":{"billId":{"type":"string"},"externalId":{"type":"string"},"status":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","description":"Public bill status. Expected value: Approved.","format":"enum"},"previousStatus":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","format":"enum"},"approvedBy":{"$ref":"#/components/schemas/ActingUser"}}},"BillCreatedEvent":{"required":["billId","status","source"],"type":"object","properties":{"billId":{"type":"string"},"status":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","description":"Public bill status. Expected value: Draft.","format":"enum"},"previousStatus":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","description":"Previous public bill status. Ingesting indicates async ingestion ran.","format":"enum"},"source":{"type":"string","description":"Source that initiated the bill, for example \"API\"."},"externalId":{"type":"string"}}},"BillDeletedEvent":{"required":["billId","deletedAt"],"type":"object","properties":{"billId":{"type":"string"},"externalId":{"type":"string"},"deletedAt":{"type":"string","format":"date-time"},"deletedBy":{"$ref":"#/components/schemas/ActingUser"}}},"BillDocumentFailedEvent":{"required":["billId","documentId"],"type":"object","properties":{"billId":{"type":"string"},"externalId":{"type":"string"},"documentId":{"type":"string"}}},"BillDocumentProcessedEvent":{"required":["billId","documentId"],"type":"object","properties":{"billId":{"type":"string"},"externalId":{"type":"string"},"documentId":{"type":"string"},"extractedFieldCount":{"type":"integer","description":"Informational count of extracted fields. Re-fetch the bill for actual values.","format":"int32"}}},"BillIngestion":{"type":"object","properties":{"documentId":{"type":"string","description":"Present when a document triggered the async build."},"expectedCompletion":{"type":"string","description":"Best-effort completion hint. Consumers should not block on this timestamp.","format":"date-time"}}},"BillMarkedAsPaidEvent":{"required":["billId","status"],"type":"object","properties":{"billId":{"type":"string"},"externalId":{"type":"string"},"status":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","description":"Public bill status. Expected value: MarkAsPaid.","format":"enum"},"previousStatus":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","format":"enum"}}},"BillPaymentDetails":{"required":["id"],"type":"object","properties":{"id":{"type":"string"},"externalReference":{"type":"string","description":"External payment provider reference when one exists."},"method":{"type":"string","description":"Payment method, for example \"ACH\", \"CHECK\", or \"WIRE\"."},"amount":{"$ref":"#/components/schemas/Currency"},"scheduledFor":{"type":"string","format":"date-time"},"estimatedDelivery":{"type":"string","format":"date-time"},"digitsTransactionId":{"type":"string","description":"Identifier included in the bank statement descriptor, for example \"DGTS.AI/AZW5YQEJ\"."},"paidAt":{"type":"string","format":"date-time"},"settledAt":{"type":"string","format":"date-time"}}},"BillPaymentFailedEvent":{"required":["billId","status","payment"],"type":"object","properties":{"billId":{"type":"string"},"externalId":{"type":"string"},"status":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","description":"Public bill status. Expected value: Failed.","format":"enum"},"previousStatus":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","format":"enum"},"payment":{"$ref":"#/components/schemas/BillPaymentDetails"}}},"BillPaymentPaidEvent":{"required":["billId","status","payment"],"type":"object","properties":{"billId":{"type":"string"},"externalId":{"type":"string"},"status":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","description":"Public bill status. Expected value: Paid.","format":"enum"},"previousStatus":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","format":"enum"},"payment":{"$ref":"#/components/schemas/BillPaymentDetails"}}},"BillPaymentProcessedEvent":{"required":["billId","status","payment"],"type":"object","properties":{"billId":{"type":"string"},"externalId":{"type":"string"},"status":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","description":"Public bill status. Expected value: ProcessingPayment.","format":"enum"},"previousStatus":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","format":"enum"},"payment":{"$ref":"#/components/schemas/BillPaymentDetails"}}},"BillPaymentRefundedEvent":{"required":["billId","status","payment","refund"],"type":"object","properties":{"billId":{"type":"string"},"externalId":{"type":"string"},"status":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","description":"Public bill status. Expected value: Refunded.","format":"enum"},"previousStatus":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","format":"enum"},"payment":{"$ref":"#/components/schemas/BillPaymentDetails"},"refund":{"$ref":"#/components/schemas/BillRefund"}}},"BillPaymentScheduledEvent":{"required":["billId","status","payment"],"type":"object","properties":{"billId":{"type":"string"},"externalId":{"type":"string"},"status":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","description":"Public bill status. Expected value: ProcessingPayment.","format":"enum"},"previousStatus":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","format":"enum"},"payment":{"$ref":"#/components/schemas/BillPaymentDetails"}}},"BillPaymentSettledEvent":{"required":["billId","status","payment"],"type":"object","properties":{"billId":{"type":"string"},"externalId":{"type":"string"},"status":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","description":"Public bill status. Expected value: Paid.","format":"enum"},"previousStatus":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","format":"enum"},"payment":{"$ref":"#/components/schemas/BillPaymentDetails"}}},"BillProcessingEvent":{"required":["billId","status","source"],"type":"object","properties":{"billId":{"type":"string"},"externalId":{"type":"string"},"status":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","description":"Public bill status. Expected value: Ingesting.","format":"enum"},"source":{"type":"string","description":"Source that initiated the bill, for example \"API\"."},"ingestion":{"$ref":"#/components/schemas/BillIngestion"}}},"BillRefund":{"required":["amount"],"type":"object","properties":{"amount":{"$ref":"#/components/schemas/Currency"},"reason":{"type":"string"}}},"BillRejectedEvent":{"required":["billId","status"],"type":"object","properties":{"billId":{"type":"string"},"externalId":{"type":"string"},"status":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","description":"Public bill status. Expected value: Rejected.","format":"enum"},"previousStatus":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","format":"enum"},"rejectedBy":{"$ref":"#/components/schemas/ActingUser"},"rejection":{"$ref":"#/components/schemas/BillRejection"}}},"BillRejection":{"type":"object","properties":{"comment":{"type":"string"}}},"BillSentForApprovalEvent":{"required":["billId","status","approverUserIds"],"type":"object","properties":{"billId":{"type":"string"},"externalId":{"type":"string"},"status":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","description":"Public bill status. Expected value: AwaitingApproval.","format":"enum"},"previousStatus":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","format":"enum"},"approverUserIds":{"type":"array","items":{"type":"string"}}}},"BillUpdatedEvent":{"required":["billId","changedFields","source"],"type":"object","properties":{"billId":{"type":"string"},"externalId":{"type":"string"},"changedFields":{"type":"array","items":{"type":"string"},"description":"Top-level or dotted paths that changed. Re-fetch the bill for current values."},"source":{"type":"string","description":"Source that initiated the update, for example \"API\"."}}},"BillVoid":{"type":"object","properties":{"reason":{"type":"string"}}},"BillVoidedEvent":{"required":["billId","status"],"type":"object","properties":{"billId":{"type":"string"},"externalId":{"type":"string"},"status":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","description":"Public bill status. Expected value: Voided.","format":"enum"},"previousStatus":{"enum":["Unknown","Ingesting","Draft","AwaitingApproval","Approved","ProcessingPayment","Paid","Deleted","Rejected","Voided","Failed","Refunded","MarkAsPaid","ScheduledToBeSentForApproval"],"type":"string","format":"enum"},"voidedBy":{"$ref":"#/components/schemas/ActingUser"},"void":{"$ref":"#/components/schemas/BillVoid"}}},"Currency":{"required":["amount","code"],"type":"object","properties":{"amount":{"type":"number","description":"Amount is expressed in minor units - $5.00 is 500¢.\n Double formatted for compatibility, only the integer component is used.","format":"double"},"code":{"type":"string","description":"Code is the ISO 4217 currency code, for example \"USD\", \"EUR\", \"JPY\""}},"description":"Currency is a minor-unit representation of an amount in the specified currency."},"GoogleProtobufAny":{"type":"object","properties":{"@type":{"type":"string","description":"The type of the serialized message."}},"additionalProperties":true,"description":"Contains an arbitrary serialized message along with a @type that describes the type of the serialized message."},"Status":{"type":"object","properties":{"code":{"type":"integer","description":"The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].","format":"int32"},"message":{"type":"string","description":"A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client."},"details":{"type":"array","items":{"$ref":"#/components/schemas/GoogleProtobufAny"},"description":"A list of messages that carry the error details.  There is a common set of message types for APIs to use."}},"description":"The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors)."},"WebhookEvent":{"required":["id","type","api_version","created","entityId","data"],"type":"object","properties":{"id":{"type":"string","description":"Event ID. Consumers should use this for idempotency."},"type":{"type":"string","description":"Event type in the form `<event_class>.<verb>`, for example `bill.created`."},"api_version":{"type":"string","description":"Public API version. Fixed to `v1` for this contract."},"created":{"type":"string","description":"Time the event originally occurred.","format":"date-time"},"entityId":{"type":"string","description":"Digits-assigned ID of the legal entity the event is about."},"entityExternalId":{"type":"string","description":"Caller-assigned ID of the legal entity the event is about, when set."},"data":{"allOf":[{"$ref":"#/components/schemas/WebhookEventData"}],"description":"Event-specific payload. Exactly one field must be populated and must match `type`."}},"description":"`WebhookEvent` is the JSON request body delivered to a configured webhook endpoint.\n\n Delivery requests include:\n - `Content-Type: application/json`\n - `User-Agent: Digits-Webhooks/1.0`\n - `Webhook-Timestamp: <unix timestamp used in the signature payload>`\n - `Webhook-Signature: v1=<hex HMAC SHA-256 signature>`\n\n The signature payload is `{Webhook-Timestamp}.{raw_request_body}`."},"WebhookEventData":{"type":"object","properties":{"billProcessing":{"allOf":[{"$ref":"#/components/schemas/BillProcessingEvent"}],"description":"Payload for `bill.processing`."},"billCreated":{"allOf":[{"$ref":"#/components/schemas/BillCreatedEvent"}],"description":"Payload for `bill.created`."},"billUpdated":{"allOf":[{"$ref":"#/components/schemas/BillUpdatedEvent"}],"description":"Payload for `bill.updated`."},"billSentForApproval":{"allOf":[{"$ref":"#/components/schemas/BillSentForApprovalEvent"}],"description":"Payload for `bill.sentForApproval`."},"billApproved":{"allOf":[{"$ref":"#/components/schemas/BillApprovedEvent"}],"description":"Payload for `bill.approved`."},"billRejected":{"allOf":[{"$ref":"#/components/schemas/BillRejectedEvent"}],"description":"Payload for `bill.rejected`."},"billPaymentScheduled":{"allOf":[{"$ref":"#/components/schemas/BillPaymentScheduledEvent"}],"description":"Payload for `bill.payment.scheduled`."},"billPaymentProcessed":{"allOf":[{"$ref":"#/components/schemas/BillPaymentProcessedEvent"}],"description":"Payload for `bill.payment.processed`."},"billPaymentPaid":{"allOf":[{"$ref":"#/components/schemas/BillPaymentPaidEvent"}],"description":"Payload for `bill.payment.paid`."},"billPaymentSettled":{"allOf":[{"$ref":"#/components/schemas/BillPaymentSettledEvent"}],"description":"Payload for `bill.payment.settled`."},"billPaymentFailed":{"allOf":[{"$ref":"#/components/schemas/BillPaymentFailedEvent"}],"description":"Payload for `bill.payment.failed`."},"billPaymentRefunded":{"allOf":[{"$ref":"#/components/schemas/BillPaymentRefundedEvent"}],"description":"Payload for `bill.payment.refunded`."},"billMarkedAsPaid":{"allOf":[{"$ref":"#/components/schemas/BillMarkedAsPaidEvent"}],"description":"Payload for `bill.markedAsPaid`."},"billVoided":{"allOf":[{"$ref":"#/components/schemas/BillVoidedEvent"}],"description":"Payload for `bill.voided`."},"billDeleted":{"allOf":[{"$ref":"#/components/schemas/BillDeletedEvent"}],"description":"Payload for `bill.deleted`."},"billDocumentProcessed":{"allOf":[{"$ref":"#/components/schemas/BillDocumentProcessedEvent"}],"description":"Payload for `bill.document.processed`."},"billDocumentFailed":{"allOf":[{"$ref":"#/components/schemas/BillDocumentFailedEvent"}],"description":"Payload for `bill.document.failed`."}},"description":"WebhookEventData contains the typed payload for a webhook event."}}},"tags":[{"name":"WebhookEvents"}]}