Download OpenAPI specification:Download
Two provides webhooks via a portal that allows you to self-manage your application's webhook subscriptions and related configuration options when receiving these webhooks. Please refer to the portal's Receiving webhooks documentation for more details about using the portal and how to consume webhook events.
To get started using the simulation endpoints and events that trigger webhooks, we have a downloadable Postman collection.
#¤ Environments
https://api.sandbox.two.inc
TBC
The simulation endpoints we provide to trigger certain webhooks are made for testing purposes only and are only available in our sandbox environment. There are some limitations with these and may not always provide fully accurate data in some edge cases.
Order reconciliation events (event types with prefix order.reconciliation.
) describe financial events related to
orders that are relevant to the buyer.
All order reconciliation events have an amount
field in the payload, which can be summed over multiple events to
calculate the amount owed by buyers (a.k.a. the outstanding amount).
The outstanding amount can be calculated on different levels by grouping/filtering on other IDs carried in the order
reconciliation events, for instance:
Payment allocation events (order.reconciliation.payment_allocated.v1
) describe the portion of a payment used to cover
an invoice. The payment
sub-structure of the payload contains information on the actual payment itself. It may be
larger than a single allocation, and may show up on multiple allocation events if used to cover more than one invoice.
Type: order.reconciliation.invoiced.v1
Occurs when an order has been successfully fulfilled and the corresponding invoice has been created by Two.
The data
object in the payload contains IDs that link the order and the invoice, along with the amount and
currency of the invoice to be paid back by the buyer.
{
"specversion": "1.0",
"id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
"type": "order.reconciliation.invoiced.v1",
"time": "2023-06-21T12:34:56.123456Z",
"source": "https://api.two.inc",
"subject": "order/a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
"twomerchantid":"b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"data": {
"root_order_id": "a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
"order_id": "a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
"invoice_id": "7a5a7b9b-7d9e-4e9e-b9b1-2d7c658e1a4d",
"merchant_id": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"billing_period_id": "175bda61-c6f2-4b9d-a429-5f31c83ecc10",
"amount": "150.65",
"currency": "GBP"
}
}
FULFILLING
to FULFILLED
, the buyer representative email specified in the order request will receive an invoice. Simultaneously, the order.reconciliation.invoiced.v1
webhook will be sent by the webhook gateway to any endpoints you have configured to receive it.Successful Response
Validation Error
{- "specversion": "1.0",
- "id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
- "type": "order.reconciliation.invoiced.v1",
- "time": "2023-06-21T12:34:56.123456Z",
- "subject": "order/a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
- "datacontenttype": "application/json",
- "twomerchantid": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "data": {
- "root_order_id": "a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
- "order_id": "a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
- "invoice_id": "7a5a7b9b-7d9e-4e9e-b9b1-2d7c658e1a4d",
- "merchant_id": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "billing_period_id": "175bda61-c6f2-4b9d-a429-5f31c83ecc10",
- "amount": "150.65",
- "currency": "GBP"
}
}
null
Type: order.reconciliation.payment_allocated.v1
Occurs when either:
It is important to note these webhooks are sent only once the payment has been matched (or unmatched) in Two's system to a specific invoice or statement, so there may be a delay between the buyer making the payment and Two being able to match that payment to an invoice/statement.
As an example, the following sequence of events show when this webhook may be issued:
matched_reference
attribute) as well as some details of the original payment made by the buyer
in the payment
object.matched_reference
value, but the details in the payment
object will be
different because it is a distinct payment from the original 400 GBP payment.The data
object in the payload contains IDs that indicate the order and invoice the payment has been allocated
to. Also note the following within the payload:
amount
: The amount for this event represents the amount of the buyer's payment that has been used by this
allocation. For payments to Two that are allocated to invoices, this amount will be negative.
For deallocation events (for example, where a credit note has a higher priority than an already-reconciled
payment and causes us to deallocate an existing allocation), the amount
will be positive. A deallocation
event would typically result in a later payment_allocated
event where all or part of the same payment
previously allocated is re-allocated against a different invoice; in this situation another
payment allocation event will be sent.payment
: Contains data about the actual transaction Two received from the buyer that has been used in this
payment allocation. See the schema description of this child object for details of each field.{
"specversion": "1.0",
"id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
"type": "order.reconciliation.payment_allocated.v1",
"time": "2023-06-21T12:34:56.123456Z",
"source": "https://api.two.inc",
"subject": "order/a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
"twomerchantid":"b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"data": {
"root_order_id": "652a57e2-c2de-437b-96a7-2eeac0a37814",
"order_id": "a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
"invoice_id": "7a5a7b9b-7d9e-4e9e-b9b1-2d7c658e1a4d",
"merchant_id": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"billing_period_id": "175bda61-c6f2-4b9d-a429-5f31c83ecc10",
"amount": "-123.45",
"currency": "GBP",
"matched_reference": "ACB12345",
"payment": {
"payment_id": "1346ef4c-fae1-43a2-b637-24e0c756d4ce",
"payment_reference": "ABC12345",
"booked_at": "2023-06-21T12:30:12.012345Z",
"payment_amount": "500.05",
"currency": "GBP"
}
}
}
order.reconciliation.invoiced.v1
webhook description for how
to do this) or use an existing order ID for the following steps.Alternatively:
Successful Response
Validation Error
{- "specversion": "1.0",
- "id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
- "type": "order.reconciliation.payment_allocated.v1",
- "time": "2023-06-21T12:34:56.123456Z",
- "subject": "order/a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
- "datacontenttype": "application/json",
- "twomerchantid": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "data": {
- "root_order_id": "652a57e2-c2de-437b-96a7-2eeac0a37814",
- "order_id": "a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
- "invoice_id": "7a5a7b9b-7d9e-4e9e-b9b1-2d7c658e1a4d",
- "merchant_id": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "billing_period_id": "175bda61-c6f2-4b9d-a429-5f31c83ecc10",
- "amount": "-123.45",
- "currency": "GBP",
- "matched_reference": "ACB12345",
- "payment": {
- "payment_id": "1346ef4c-fae1-43a2-b637-24e0c756d4ce",
- "payment_reference": "ABC12345",
- "booked_at": "2023-06-21T12:30:12.012345Z",
- "payment_amount": "500.05",
- "currency": "GBP"
}
}
}
null
Type: order.reconciliation.credited.v1
Occurs when a credit note is applied against an invoice.
The data
object in the payload contains IDs that indicate the order and invoice the credit note has been
applied to. Also note the following within the payload:
credit_note
: Contains information about the credit note itself, including its ID, the amount on the credit
note and when the credit note was applied.{
"specversion": "1.0",
"id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
"type": "order.reconciliation.credited.v1",
"time": "2023-06-21T12:34:56.123456Z",
"source": "https://api.two.inc",
"subject": "order/a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
"twomerchantid":"b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"data": {
"root_order_id": "652a57e2-c2de-437b-96a7-2eeac0a37814",
"order_id": "a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
"invoice_id": "7a5a7b9b-7d9e-4e9e-b9b1-2d7c658e1a4d",
"merchant_id": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"billing_period_id": "175bda61-c6f2-4b9d-a429-5f31c83ecc10",
"amount": "-101.65",
"currency": "GBP",
"credit_note": {
"refund_id": "433401fe-76ae-4e10-b091-59788c90a5df",
"credited_at": "2023-06-21T12:30:12.012345Z",
"credit_note_amount": "101.65"
}
}
}
order.reconciliation.invoiced.v1
webhook for details).order.reconciliation.credited.v1
webhook will be sent to any endpoints subscribed to this event.Successful Response
Validation Error
{- "specversion": "1.0",
- "id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
- "type": "order.reconciliation.credited.v1",
- "time": "2023-06-21T12:34:56.123456Z",
- "subject": "order/a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
- "datacontenttype": "application/json",
- "twomerchantid": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "data": {
- "root_order_id": "652a57e2-c2de-437b-96a7-2eeac0a37814",
- "order_id": "a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
- "invoice_id": "7a5a7b9b-7d9e-4e9e-b9b1-2d7c658e1a4d",
- "merchant_id": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "billing_period_id": "175bda61-c6f2-4b9d-a429-5f31c83ecc10",
- "amount": "-101.65",
- "currency": "GBP",
- "credit_note": {
- "refund_id": "433401fe-76ae-4e10-b091-59788c90a5df",
- "credited_at": "2023-06-21T12:30:12.012345Z",
- "credit_note_amount": "101.65"
}
}
}
null
Type: order.reconciliation.recoursed.v1
Occurs when Two applies the option to recourse an invoice back to the merchant. This may not be applicable to your contract with Two so you may never see recourse events.
The data
object in the payload contains IDs that indicate the order and invoice that have been recoursed. Also
note the following child object within the payload:
recourse
: Contains specific information about the recourse event as recorded in the Two system, including
the specific amount that has been recoursed back to the merchant.{
"specversion": "1.0",
"id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
"type": "order.reconciliation.recoursed.v1",
"time": "2023-06-21T12:34:56.123456Z",
"source": "https://api.two.inc",
"subject": "order/a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
"twomerchantid":"b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"data": {
"root_order_id": "652a57e2-c2de-437b-96a7-2eeac0a37814",
"order_id": "a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
"invoice_id": "7a5a7b9b-7d9e-4e9e-b9b1-2d7c658e1a4d",
"merchant_id": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"billing_period_id": "175bda61-c6f2-4b9d-a429-5f31c83ecc10",
"amount": "-101.65",
"currency": "GBP",
"recourse": {
"recourse_id": "4228e51d-45ba-4a7f-a279-0f332bfead9c",
"recoursed_at": "2023-06-31T12:34:56.123456",
"recourse_amount": "101.65"
}
}
}
order.reconciliation.invoiced.v1
webhook for details).order.reconciliation.recoursed.v1
webhook will be sent to any endpoints subscribed to this event.Successful Response
Validation Error
{- "specversion": "1.0",
- "id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
- "type": "order.reconciliation.recoursed.v1",
- "time": "2023-06-21T12:34:56.123456Z",
- "subject": "order/a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
- "datacontenttype": "application/json",
- "twomerchantid": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "data": {
- "root_order_id": "652a57e2-c2de-437b-96a7-2eeac0a37814",
- "order_id": "a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
- "invoice_id": "7a5a7b9b-7d9e-4e9e-b9b1-2d7c658e1a4d",
- "merchant_id": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "billing_period_id": "175bda61-c6f2-4b9d-a429-5f31c83ecc10",
- "amount": "-101.65",
- "currency": "GBP",
- "recourse": {
- "recourse_id": "4228e51d-45ba-4a7f-a279-0f332bfead9c",
- "recoursed_at": "2023-06-21T12:34:56.123456Z",
- "recourse_amount": "101.65"
}
}
}
null
Type: order.reconciliation.collected.v1
Occurs when Two reverts to using a collection agency for recovering any outstanding amounts owed by a buyer for an invoice.
The data
object in the payload contains IDs that indicate the order and invoice that have been sent to the
collection agency. Also note the following child object within the payload:
collection
: Contains specific information about the collection that caused this event, including the amount
Two has asked the collection agency to recover.{
"specversion": "1.0",
"id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
"type": "order.reconciliation.collected.v1",
"time": "2023-06-21T12:34:56.123456Z",
"source": "https://api.two.inc",
"subject": "order/a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
"twomerchantid":"b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"data": {
"root_order_id": "652a57e2-c2de-437b-96a7-2eeac0a37814",
"order_id": "a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
"invoice_id": "7a5a7b9b-7d9e-4e9e-b9b1-2d7c658e1a4d",
"merchant_id": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"billing_period_id": "175bda61-c6f2-4b9d-a429-5f31c83ecc10",
"amount": "-101.65",
"currency": "GBP",
"collection": {
"collection_id": "8d5f0cf6-0aee-4cb3-9723-ee221cdfc681",
"collected_at": "2023-06-30T12:34:56.123456",
"collection_amount": "101.65"
},
}
}
order.reconciliation.invoiced.v1
webhook for details).order.reconciliation.collected.v1
webhook will be sent to any endpoint subscribed to this event.Successful Response
Validation Error
{- "specversion": "1.0",
- "id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
- "type": "order.reconciliation.collected.v1",
- "time": "2023-06-21T12:34:56.123456Z",
- "subject": "order/a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
- "datacontenttype": "application/json",
- "twomerchantid": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "data": {
- "root_order_id": "652a57e2-c2de-437b-96a7-2eeac0a37814",
- "order_id": "a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
- "invoice_id": "7a5a7b9b-7d9e-4e9e-b9b1-2d7c658e1a4d",
- "merchant_id": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "billing_period_id": "175bda61-c6f2-4b9d-a429-5f31c83ecc10",
- "amount": "-101.65",
- "currency": "GBP",
- "collection": {
- "collection_id": "8d5f0cf6-0aee-4cb3-9723-ee221cdfc681",
- "collected_at": "2023-06-30T12:34:56.123456",
- "collection_amount": "101.65"
}
}
}
null
Type: order.verified.v1
Occurs when an order has been successfully verified and is in a fulfillable state.
The data
object in the payload contains order ID, along with the amount and currency.
{
"specversion": "1.0",
"id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
"type": "order.verified.v1",
"time": "2023-06-21T12:34:56.123456Z",
"source": "https://api.two.inc",
"subject": "order/a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
"twomerchantid":"b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"data": {
"order_id": "a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
"merchant_order_id": "999999",
"merchant_id": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"gross_amount": "150.65",
"currency": "GBP"
"buyer_company_name": "TWO B2B LTD",
}
}
payment_url
in the response body and complete verification (in production, this step would be completed by the buyer).UNVERIFIED
to VERIFIED
, the order.state.verified.v1
webhook will be sent by the webhook gateway to any endpoints you have configured to receive it.Successful Response
Validation Error
{- "specversion": "1.0",
- "id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
- "type": "order.verified.v1",
- "time": "2023-06-21T12:34:56.123456Z",
- "subject": "order/a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
- "datacontenttype": "application/json",
- "twomerchantid": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "data": {
- "order_id": "a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
- "merchant_order_id": "999999",
- "merchant_id": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "gross_amount": "150.65",
- "currency": "GBP",
- "buyer_company_name": "TWO B2B LTD"
}
}
null
Type: customer.credit_limit.updated.v1
Occurs when the available credit for a merchant's buyer changes.
The data
object in the payload contains identifiers for the buyer organisation, as well as the new available
credit limit information. If the credit limit changes such that Two no longer accepts the buyer, the payload may
include a reason for the change.
{
"specversion":"1.0",
"id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
"type": "customer.credit_limit.updated.v1",
"time": "2023-06-21T12:34:56.123456Z",
"source": "https://api.two.inc",
"subject": "customer/GB/12345678",
"twomerchantid":"b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"data": {
"buyer_organization_number": "12345678",
"country": "GB",
"credit_limit": "1000.00",
"credit_limit_balance": "800.00",
"max_single_order_value": "100.00",
"buyer_is_in_arrears": true,
"currency": "GBP",
"credit_approved": false,
"decline_reason": "Buyer is late on existing active invoices that need to be cleared before they are able to place more orders."
}
}
order.reconciliation.invoiced.v1
webhook for details).customer.credit_limit.updated.v1
webhook will be sent to any endpoints subscribed to this event.Alternatively, you can trigger a simulated credit limit update for a given combination of buyer organisation number, country code and currency using the "Simulate credit limit update" endpoint in the Two webhooks Postman collection.
Successful Response
Validation Error
{- "specversion": "1.0",
- "id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
- "type": "customer.credit_limit.updated.v1",
- "time": "2023-06-21T12:34:56.123456Z",
- "subject": "customer/GB/12345678",
- "datacontenttype": "application/json",
- "twomerchantid": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "message": "The credit limit for your customer Example Ltd (12345678) in GB remains at 1000.00 GBP. Their balance has decreased from 1000.00 GBP to 800.00 GBP.",
- "data": {
- "buyer_company_name": "Example Ltd",
- "buyer_organization_number": "12345678",
- "country": "GB",
- "previous_credit_limit": "1000.00",
- "previous_credit_limit_balance": "1000.00",
- "credit_limit": "1000.00",
- "credit_limit_balance": "800.00",
- "max_single_order_value": "100.00",
- "buyer_is_in_arrears": true,
- "currency": "GBP",
- "credit_approved": false,
- "decline_reason": "Buyer is late on existing active invoices that need to be cleared before they are able to place more orders."
}
}
null
Type: billing_statement.created.v1
Occurs when a billing statement is issued.
The data
object in the payload contains details of all invoices and credit notes related to the statement.
These credit notes and invoices will all have the same billing_period_id
in the credit note issued and invoice
issued webhooks, respectively.
{
"specversion": "1.0",
"id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
"type": "billing_statement.created.v1",
"time": "2023-06-21T12:34:56.123456Z",
"source": "https://api.two.inc",
"subject": "billing_account/c8b27c7c-3362-4c10-b4e5-7d68c8b554be",
"twomerchantid":"b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"data": {
"invoices": [
{
"root_order_id": "a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
"order_id": "a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
"invoice_id": "7a5a7b9b-7d9e-4e9e-b9b1-2d7c658e1a4d",
"amount": "190.65",
},
]
"credit_notes": [
{
"refund_id": "433401fe-76ae-4e10-b091-59788c90a5df",
"credited_amount": "-40.00"
},
]
"merchant_id": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"billing_period_id": "175bda61-c6f2-4b9d-a429-5f31c83ecc10",
"statement_number": "1004",
"payment_reference": "234234234",
"gross_amount": "150.65",
"outstanding_amount": "120.65",
"currency": "GBP"
"due_date": "2023-06-21T12:34:56.123456Z",
"issue_date": "2023-06-05T12:34:56.123456Z",
"billing_account_id": "c8b27c7c-3362-4c10-b4e5-7d68c8b554be",
}
}
"billing_account_id": "<id>"
field
in the body of the request.order.reconciliation.invoiced.v1
for details).billing_statement.created.v1
webhook will be sent to any endpoints subscribed to this event.Successful Response
Validation Error
{- "specversion": "1.0",
- "id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
- "type": "billing_statement.created.v1",
- "time": "2023-06-21T12:34:56.123456Z",
- "subject": "billing_account/<billing_account_id>",
- "datacontenttype": "application/json",
- "twomerchantid": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "data": {
- "invoices": [
- {
- "root_order_id": "a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
- "order_id": "a9f5d2d3-5d6d-4e2a-a4b4-6c7f8a9d0f1e",
- "invoice_id": "7a5a7b9b-7d9e-4e9e-b9b1-2d7c658e1a4d",
- "amount": "190.65",
- "invoice_number": 10000001
}
], - "credit_notes": [
- {
- "refund_id": "433401fe-76ae-4e10-b091-59788c90a5df",
- "credited_amount": "-40.00"
}
], - "merchant_id": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "billing_period_id": "175bda61-c6f2-4b9d-a429-5f31c83ecc10",
- "statement_number": "1004",
- "payment_reference": "234234234",
- "gross_amount": "150.65",
- "outstanding_amount": "120.65",
- "currency": "GBP",
- "due_date": "2023-06-21T12:34:56.123456Z",
- "issue_date": "2023-06-05T12:34:56.123456Z",
- "billing_account_id": "c8b27c7c-3362-4c10-b4e5-7d68c8b554be"
}
}
null
Type: business_registry.approved.v1
Occurs when a proposal to enroll a new business (e.g. a sole trader) has been approved, the enrollment has been completed, and the new business is ready for ordering/trade account creation/etc.
The data
object in the payload contains the following:
{
"specversion": "1.0",
"id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
"type": "business_registry.approved.v1",
"time": "2023-06-21T12:34:56.123456Z",
"source": "https://api.two.inc",
"subject": "business_registry",
"twomerchantid":"b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"data": {
"proposal_id": "558f57b4-8161-4765-a73e-a67d73f9c245",
"merchant_id": "1eb39178-c652-4784-9eee-af7e25b28a4c",
"organization_number": "1234567",
}
}
This webhook object is emitted whenever a proposal is approved. In the sandbox environment, proposals are automatically approved immediately on submission. To prompt Two to emit an example of this object, simply create and then submit a proposal.
Successful Response
Validation Error
{- "specversion": "1.0",
- "id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
- "type": "business_registry.approved.v1",
- "time": "2023-06-21T12:34:56.123456Z",
- "subject": "business_registry",
- "datacontenttype": "application/json",
- "twomerchantid": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "data": {
- "proposal_id": "558f57b4-8161-4765-a73e-a67d73f9c245",
- "merchant_id": "1eb39178-c652-4784-9eee-af7e25b28a4c",
- "organization_number": "1234567"
}
}
null
Type: business_registry.rejected.v1
Occurs when a proposal to enroll a new business (e.g. a sole trader) has been rejected or withdrawn.
The data
object in the payload contains the following:
{
"specversion": "1.0",
"id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
"type": "business_registry.rejected.v1",
"time": "2023-06-21T12:34:56.123456Z",
"source": "https://api.two.inc",
"subject": "business_registry",
"twomerchantid":"b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"data": {
"proposal_id": "558f57b4-8161-4765-a73e-a67d73f9c245",
"rejection_reason": "Some reason",
"merchant_id": "1eb39178-c652-4784-9eee-af7e25b28a4c",
}
}
This webhook object is emitted whenever a proposal is rejected or withdrawn. To prompt Two to emit an example of this object, simply create and then withdraw a proposal.
Successful Response
Validation Error
{- "specversion": "1.0",
- "id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
- "type": "business_registry.rejected.v1",
- "time": "2023-06-21T12:34:56.123456Z",
- "subject": "business_registry",
- "datacontenttype": "application/json",
- "twomerchantid": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "data": {
- "proposal_id": "558f57b4-8161-4765-a73e-a67d73f9c245",
- "rejection_reason": "Some reason",
- "merchant_id": "1eb39178-c652-4784-9eee-af7e25b28a4c"
}
}
null
Type: instalments.invoiced.v1
Occurs when an invoice including one or more instalments is created.
The data
object in the payload contains IDs that indicate the invoice that has been created and the associated
merchant and instalment plan. Also note the following child objects within the payload:
tax_subtotals
: Contains specific information about the tax subtotals of the invoice.instalments
: Contains specific information about the instalments comprising the invoice.{
"specversion": "1.0",
"id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
"type": "instalments.invoiced.v1",
"time": "2023-06-21T12:34:56.123456",
"source": "webhooks.two.inc",
"subject": "instalment_account/044d6cf0-0f51-11ec-82a8-0242ac130003",
"twomerchantid":"b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"data": {
"invoice_id": "e39f3206-0f94-4b9d-9f8f-1b2bae1e2bc9",
"merchant_id": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"issue_date": "2023-06-05T12:34:56.123456",
"due_date": "2023-06-05T12:34:56.123456",
"invoice_number": "90000001",
"instalment_account_id": "044d6cf0-0f51-11ec-82a8-0242ac130003",
"gross_amount": "1000.00",
"tax_subtotals": [
{
"tax_rate": "0.250000",
"taxable_amount": "500.00",
"tax_amount": "125.00"
},
{
"tax_rate": "0.000000",
"taxable_amount": "500.00",
"tax_amount": "0.00"
}
],
"instalments": [
{
"plan_id": "b6c9de3c-5d51-4a9d-89b1-63e1a9f7c5e5",
"instalment_id": "a0f4bc40-8c5d-4b80-8c40-7d1f0b5a1f74"
},
{
"plan_id": "ff6b6e3e-5e0e-4d27-bc62-4e5a3a80e7f4",
"instalment_id": "d2f5f79b-1e5a-4fe3-9e53-0b3a4b2c1c1b"
}
]
}
}
Successful Response
Validation Error
{- "specversion": "1.0",
- "id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
- "type": "instalments.invoiced.v1",
- "time": "2023-06-21T12:34:56.123456",
- "source": "webhooks.two.inc",
- "subject": "instalment_acccount/044d6cf0-0f51-11ec-82a8-0242ac130003",
- "datacontenttype": "application/json",
- "twomerchantid": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "data": {
- "invoice_id": "e39f3206-0f94-4b9d-9f8f-1b2bae1e2bc9",
- "merchant_id": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "issue_date": "2023-06-05",
- "due_date": "2023-06-05",
- "invoice_number": "90000001",
- "payment_reference": "p123456",
- "instalment_account_id": "044d6cf0-0f51-11ec-82a8-0242ac130003",
- "gross_amount": "1000.00",
- "tax_subtotals": [
- {
- "tax_rate": "0.250000",
- "taxable_amount": "500.00",
- "tax_amount": "125.00"
}, - {
- "tax_rate": "0.000000",
- "taxable_amount": "500.00",
- "tax_amount": "0.00"
}
], - "instalments": [
- {
- "plan_id": "b6c9de3c-5d51-4a9d-89b1-63e1a9f7c5e5",
- "instalment_id": "a0f4bc40-8c5d-4b80-8c40-7d1f0b5a1f74"
}, - {
- "plan_id": "ff6b6e3e-5e0e-4d27-bc62-4e5a3a80e7f4",
- "instalment_id": "d2f5f79b-1e5a-4fe3-9e53-0b3a4b2c1c1b"
}
]
}
}
null
Type: customer.user.verified.v1
Occurs when a customer user successfully completes verification
The data
object in the payload contains IDs that indicate your merchant_user_id that has been verified and your associated
merchant_customer_id
{
"specversion":"1.0",
"id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
"type": "customer.user.verified.v1",
"time": "2023-06-21T12:34:56.123456Z",
"source": "https://api.two.inc",
"subject": "customer/user/external-user-id-123",
"twomerchantid":"b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"data": {
"merchant_id": "12345678",
"merchant_customer_id": "external-customer-123",
"merchant_user_id": "external-user-id-123",
}
customer.user.verified.v1
webhook will be sent to any endpoints subscribed to this event.Successful Response
Validation Error
{- "specversion": "1.0",
- "id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
- "type": "customer.user.verified.v1",
- "time": "2023-06-21T12:34:56.123456Z",
- "subject": "customer/614d1ba5-1b38-4203-b783-2e6a5ecb82d0/user/3fee121e-2f31-40de-97f6-613345fda4e2",
- "datacontenttype": "application/json",
- "twomerchantid": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "data": {
- "merchant_id": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "merchant_customer_id": "external-123545",
- "customer_id": "614d1ba5-1b38-4203-b783-2e6a5ecb82d0",
- "merchant_user_id": "external-12345",
- "user_id": "3fee121e-2f31-40de-97f6-613345fda4e2"
}
}
null
Type: merchant.payee_account.activated.v1
Occurs when a payee account for a given country and invoice type for a merchant is activated
The data
object in the payload contains data that indicates a merchant has been activated. Payload will
include merchant_id, merchant_legal_name, merchant_country_code of merchant and country code and invoice type
of activated payee account.
{
"specversion":"1.0",
"id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
"type": "merchant.payee_account.activated.v1",
"time": "2023-06-21T12:34:56.123456Z",
"source": "https://api.two.inc",
"subject": "merchant/b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"twomerchantid":"b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"data": {
"merchant_id": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"merchant_legal_name": "Example Merchant Ltd",
"merchant_country_code": "GB",
"payee_account_country_code": "GB",
"payee_account_invoice_type": "FUNDED_INVOICE",
}
This webhook object is emitted whenever a new active payee account for country code and invoice type for a merchant is activated and the country invoice type combination has no other active payee accounts. Use case is for merchants activating a new payee account for a country and invoice type to inform partner merchant of activation.
Successful Response
Validation Error
{- "specversion": "1.0",
- "id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
- "type": "merchant.payee_account.activated.v1",
- "time": "2023-06-21T12:34:56.123456Z",
- "subject": "merchant/614d1ba5-1b38-4203-b783-2e6a5ecb82d0",
- "datacontenttype": "application/json",
- "twomerchantid": "614d1ba5-1b38-4203-b783-2e6a5ecb82d0",
- "data": {
- "merchant_id": "614d1ba5-1b38-4203-b783-2e6a5ecb82d0",
- "merchant_legal_name": "Example Merchant Ltd",
- "merchant_country_code": "GB",
- "payee_account_country_code": "GB",
- "payee_account_invoice_type": "FUNDED_INVOICE"
}
}
null
Type: customer.in_arrears_block.v1
Occurs for the first 7 days when a customer enters into arrears, meaning they have an unpaid invoice that is more than 28 days past due and are now unable to place orders until they repay their most overdue invoices that meet this past 28 days condition
The data
object in the payload contains data that indicates the customer details who has entered
into arrears, and further details on the invoices that are most overdue if they belong to this merchant
{
"specversion": "1.0",
"id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
"type": "customer.in_arrears_block.v1",
"time": "2023-06-21T12:34:56.123456Z",
"source": "https://api.two.inc",
"subject": "in_arrears_block",
"twomerchantid": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"message": (
"Two B2b LTD (13078389) is now in arrears."
"Please see the details for the invoice that is due the earliest"
),
"data": {
"buyer_company_name": "Two B2b LTD",
"buyer_organization_number": "13078389",
"days_in_arrears": 5,
"earliest_invoice_due_belongs_to_merchant": True,
"earliest_invoice_number": "123123",
"earliest_invoice_due_date": "2024-05-05",
"earliest_invoice_gross_amount": 100.0,
"earliest_invoice_currency": "GBP"
}
}
There is no active trigger to send this webhook as it runs as a cronjob on a daily schedule if the arrears conditions are met for any customer from this merchant. The SVIX portal however allows for test events to be sent to a given endpoint
Successful Response
Validation Error
{- "specversion": "1.0",
- "id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
- "type": "customer.in_arrears_block.v1",
- "time": "2023-06-21T12:34:56.123456Z",
- "subject": "in_arrears_block",
- "twomerchantid": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "message": "Two B2b LTD (13078389) is now in arrears. Please see the details for the invoice that is due the earliest",
- "data": {
- "buyer_company_name": "Two B2b LTD",
- "buyer_organization_number": "13078389",
- "days_in_arrears": 5,
- "earliest_invoice_due_belongs_to_merchant": true,
- "earliest_invoice_number": "123123",
- "earliest_invoice_due_date": "2024-05-05",
- "earliest_invoice_gross_amount": 100,
- "earliest_invoice_currency": "GBP"
}
}
null
Type: customer.approaching_arrears_block.v1
Starts occurring 7 days before a customer enters into arrears, meaning they have an unpaid invoice that is than 21 days or more past due and are about to be unable to place orders until they repay their most overdue invoices that meet this past 28 days condition
The data
object in the payload contains data that indicates the customer details who is about to enter
into arrears, and further details on the invoices that are most overdue if they belong to this merchant
{
"specversion": "1.0",
"id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
"type": "customer.approaching_arrears_block.v1",
"time": "2023-06-21T12:34:56.123456Z",
"source": "https://api.two.inc",
"subject": "approaching_arrears_block",
"twomerchantid": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
"message": (
"Two B2b LTD (13078389) is approaching arrears with another "
f"merchant in 5 days. Please encourage them to repay any severely "
"overdue invoices they have to be able to place orders on your website again""
),
"data": {
"buyer_company_name": "Two B2b LTD",
"buyer_organization_number": "13078389",
"days_until_arrears": 5,
"earliest_invoice_due_belongs_to_merchant": False,
"earliest_invoice_number": None,
"earliest_invoice_due_date": None,
"earliest_invoice_gross_amount": None,
"earliest_invoice_currency": None
}
}
There is no active trigger to send this webhook as it runs as a cronjob on a daily schedule if the arrears conditions are met for any customer from this merchant. The SVIX portal however allows for test events to be sent to a given endpoint
Successful Response
Validation Error
{- "specversion": "1.0",
- "id": "01FBJ0PYJ7931K0CJ6GMP8N3WG",
- "type": "customer.approaching_arrears_block.v1",
- "time": "2023-06-21T12:34:56.123456Z",
- "subject": "approaching_arrears_block",
- "twomerchantid": "b6b9d5d1-f6b7-4e15-9703-9c32c6e5c1c2",
- "message": "TWO B2B AS (1307839) is approaching arrears with another merchant in 2 days. Please encourage them to repay any severely overdue invoices they have to be able to place orders on your website again",
- "data": {
- "buyer_company_name": "TWO B2B AS",
- "buyer_organization_number": "13078389",
- "days_until_arrears": 2,
- "earliest_invoice_due_belongs_to_merchant": false
}
}
null