Example Webhooks

Event Structure

For each webhook that is sent to the receiving system, a JSON payload will be included with the following structure:

NameTypeDescription
eventstringThe event name in the format of type:event, such as purchase:success
payloadArray or ObjectThe payload of the webhook. Usually this will either be the record as a hash you would normally receive via the API, or an array of hashes, where a webhook is triggered at one time for multiple objects

For Webhooks triggered as a result of batch operations (for example, direct entry completion or rejection) the request sent will contain an array of objects under the payload field. Please ensure that your code checks for an object or array before processing the request.

Purchases

{
  "event": "purchase:success",
  "payload": {
    "authorization": "389768",
    "id": "071-P-245JAGI0",
    "card_number": "400555XXXXXX0001",
    "card_holder": "Joe Bloggs",
    "card_expiry": "2023-05-31",
    "card_token": "fke8tr3e",
    "card_type": "VISA",
    "card_category": "Credit",
    "card_subcategory": "Standard",
    "amount": 123,
    "decimal_amount": 1.23,
    "successful": true,
    "message": "Approved",
    "reference": "0k7uchjosk38",
    "currency": "AUD",
    "transaction_id": "071-P-245JAGI0",
    "settlement_date": "2018-09-07",
    "transaction_date": "2018-09-07T17:06:00+10:00",
    "response_code": "00",
    "captured": true,
    "captured_amount": 123,
    "rrn": "071P245JAGI0",
    "cvv_match": "M",
    "metadata": {
      
    },
    "addendum_data": {
      
    }
  }
}
{
  "event": "purchase:failed",
  "payload": {
    "authorization": null,
    "id": "071-P-C68432C5",
    "card_number": "400000XXXXXXXXX5678",
    "card_holder": "Joe Bloggs",
    "card_expiry": "2023-05-31",
    "card_token": "fke8saky",
    "card_type": "VISA",
    "card_category": "Credit",
    "card_subcategory": "Credit",
    "amount": 123,
    "decimal_amount": 1.23,
    "successful": false,
    "message": "Declined",
    "reference": "0balpb3tfglq",
    "currency": "AUD",
    "transaction_id": "071-P-C68432C5",
    "settlement_date": "2018-09-07",
    "transaction_date": "2018-09-07T17:06:07+10:00",
    "response_code": "23",
    "captured": false,
    "captured_amount": 0,
    "rrn": null,
    "cvv_match": "M",
    "metadata": {
      
    },
    "addendum_data": {
      
    }
  }
}

Refunds

{
  "event": "refund:success",
  "payload": {
    "authorization": "1533336051",
    "id": "071-R-3RCHNEJT",
    "amount": 1000,
    "refunded": "Approved",
    "message": "Approved",
    "card_holder": "Jim Smith",
    "card_number": "512345XXXXXX2346",
    "card_expiry": "2023-05-31",
    "card_type": "MasterCard",
    "transaction_id": "071-R-3RCHNEJT",
    "reference": "rmt1533336049913",
    "currency": "AUD",
    "successful": true,
    "transaction_date": "2018-08-04T08:40:51+10:00",
    "response_code": "00",
    "settlement_date": "2018-08-05",
    "metadata": {
      
    },
    "standalone": false,
    "rrn": "071R3RCHNEJT"
  }
}
{
  "event": "refund:failed",
  "payload": {
    "authorization": "1533336051",
    "id": "071-R-3RCHNEJT",
    "amount": 1000,
    "refunded": "Declined",
    "message": "Declined",
    "card_holder": "Jim Smith",
    "card_number": "512345XXXXXX2346",
    "card_expiry": "2023-05-31",
    "card_type": "MasterCard",
    "transaction_id": "071-R-3RCHNEJT",
    "reference": "rmt1533336049913",
    "currency": "AUD",
    "successful": false,
    "transaction_date": "2018-08-04T08:40:51+10:00",
    "response_code": "05",
    "settlement_date": "2018-08-05",
    "metadata": {
      
    },
    "standalone": false,
    "rrn": "071R3RCHNEJT"
  }
}

Direct Entries

{
  "event": "direct_entry:created",
  "payload": {
    "id": "1229-DD-C3VM4MXV",
    "amount": 10.0,
    "bsb": "085-124",
    "account_number": "091765432",
    "account_name": "Bob Smith",
    "description": "DD INV002",
    "reference": "DD1357924680004",
    "date": "2019-12-25",
    "process_date": null,
    "status": "New",
    "result": null,
    "type": "Debit",
    "metadata": {}
  }
}
{
  "event": "direct_entry:submitted",
  "payload": [
    {
      "id": "1229-DD-C3VM4MXV",
      "amount": 10.0,
      "bsb": "085-124",
      "account_number": "091765432",
      "account_name": "Bob Smith",
      "description": "DD INV002",
      "reference": "DD1357924680004",
      "date": "2019-12-25",
      "process_date": "2019-12-25",
      "status": "Pending",
      "result": "Submitted to Institution",
      "type": "Debit",
      "metadata": {}
    }
  ]
}
{
  "event": "direct_entry:completed",
  "payload": [
    {
      "id": "1229-DD-C3VM4MXV",
      "amount": 10.0,
      "bsb": "085-124",
      "account_number": "091765432",
      "account_name": "Bob Smith",
      "description": "DD INV002",
      "reference": "DD1357924680004",
      "date": "2019-12-25",
      "process_date": "2019-12-25",
      "status": "Completed",
      "result": "Submitted to Institution",
      "type": "Debit",
      "metadata": {}
    }
  ]
}
{
  "event": "direct_entry:rejected",
  "payload": [
    {
      "id": "1229-DD-C3VM4MXV",
      "amount": 10.0,
      "bsb": "085-124",
      "account_number": "091765432",
      "account_name": "Bob Smith",
      "description": "DD INV002",
      "reference": "DD1357924680004",
      "date": "2019-12-25",
      "process_date": "2019-12-25",
      "status": "Rejected",
      "result": "Invalid Account",
      "type": "Debit",
      "metadata": {}
    }
  ]
}

Payment Plans

{
  {
    "event": "payment_plan:active",
    "payload": {
      "id": "1486-PP-ECY8AH07",
      "customer": "1486-C-9R9FY0FE",
      "amount": 25000,
      "currency": "AUD",
      "setup_fee": 0,
      "frequency": "Monthly",
      "anniversary": 1,
      "start_date": "2018-08-04",
      "end_date": null,
      "total_count": null,
      "total_amount": null,
      "payment_method": "Credit Card",
      "reference": "Plan456",
      "description": "",
      "status": "Active",
      "status_reason": "None",
      "created_at": "2018-08-03T10:28:09.901+10:00",
      "failed_payment_fee": 0,
      "retry_interval": 3,
      "status_change_date": null,
      "payments": [
        {
          "id": "1486-PT-ASASNHVE",
          "payment_plan": "1486-PP-ECY8AH07",
          "reference": "Plan456-0001",
          "amount": 25000,
          "currency": "AUD",
          "scheduled_date": "2018-09-01",
          "payment_method": "Credit Card",
          "status": "Scheduled",
          "result": null,
          "records": []
        }
      ]
    }
  }
}
{
  {
    "event": "payment_plan:completed",
    "payload": {
      "id": "1486-PP-ECY8AH07",
      "customer": "1486-C-9R9FY0FE",
      "amount": 25000,
      "currency": "AUD",
      "setup_fee": 0,
      "frequency": "Monthly",
      "anniversary": 1,
      "start_date": "2018-08-04",
      "end_date": "2018-09-04",
      "total_count": 1,
      "total_amount": 25000,
      "payment_method": "Credit Card",
      "reference": "Plan456",
      "description": "",
      "status": "Completed",
      "status_reason": "Contract Completed",
      "created_at": "2018-08-03T10:28:09.901+10:00",
      "failed_payment_fee": 0,
      "retry_interval": 3,
      "status_change_date": null,
      "payments": [
        {
          "id": "1486-PT-ASASNHVE",
          "payment_plan": "1486-PP-ECY8AH07",
          "reference": "Plan456-0001",
          "amount": 25000,
          "currency": "AUD",
          "scheduled_date": "2018-09-01",
          "payment_method": "Credit Card",
          "status": "Completed",
          "result": "Approved",
          "records": [
            {
              "authorization": "389768",
              "id": "071-P-245JAGI0",
              "card_number": "400555XXXXXX0001",
              "card_holder": "Joe Bloggs",
              "card_expiry": "2023-05-31",
              "card_token": "fke8tr3e",
              "card_type": "VISA",
              "card_category": "Credit",
              "card_subcategory": "Standard",
              "amount": 123,
              "decimal_amount": 1.23,
              "successful": true,
              "message": "Approved",
              "reference": "Plan456-0001",
              "currency": "AUD",
              "transaction_id": "071-P-245JAGI0",
              "settlement_date": "2018-09-07",
              "transaction_date": "2018-09-07T17:06:00+10:00",
              "response_code": "00",
              "captured": true,
              "captured_amount": 123,
              "rrn": "071P245JAGI0",
              "cvv_match": "M",
              "metadata": {},
              "addendum_data": {}
            }
          ]
        }
      ]
    }
  }
}
{
  {
    "event": "payment_plan:suspended",
    "payload": {
      "id": "379-PP-1OJWI7G1",
      "customer": "379-C-WHWWBSZ6",
      "amount": 800,
      "currency": "AUD",
      "setup_fee": 0,
      "frequency": "Monthly",
      "anniversary": 1,
      "start_date": "2018-08-01",
      "end_date": null,
      "total_count": 12,
      "total_amount": 9600,
      "payment_method": "Credit Card",
      "reference": "#46047-1533013368",
      "description": null,
      "status": "Suspended",
      "status_reason": "Invalid Account",
      "created_at": "2018-07-31T15:02:49.082+10:00",
      "failed_payment_fee": 0,
      "retry_interval": 3,
      "status_change_date": null,
      "payments": [
        {
          "id": "379-PT-A6OKNFAL",
          "payment_plan": "379-PP-1OJWI7G1",
          "reference": "#46047-1533013368-0001",
          "amount": 800,
          "currency": "AUD",
          "scheduled_date": "2018-08-01",
          "payment_method": "Credit Card",
          "status": "Error",
          "result": "Expired Card",
          "records": []
        }
      ]
    }
  }
}
{
  {
    "event": "payment_plan:cancelled",
    "payload": {
      "id": "071-PP-Q5KPBK9J",
      "customer": "071-C-ZWD0ZUNT",
      "amount": 100,
      "currency": null,
      "setup_fee": 0,
      "frequency": "Weekly",
      "anniversary": 5,
      "start_date": "2018-10-28",
      "end_date": null,
      "total_count": 5,
      "total_amount": 500,
      "payment_method": "Credit Card",
      "reference": "761cb4d0e5dfd280ef172afee7689857",
      "description": null,
      "status": "Cancelled",
      "status_reason": "Other",
      "created_at": "2018-07-30T17:42:17.750+10:00",
      "failed_payment_fee": 0,
      "retry_interval": 3,
      "status_change_date": null,
      "payments": []
    }
  }
}

Payment Plan Payments

{
  {
    "event": "payment_plan_payment:completed",
    "payload": {
      "id": "787-PT-G1EBHXZR",
      "payment_plan": "787-PP-4745AS4X",
      "reference": "PPAPI-001-0400",
      "amount": 10,
      "currency": "AUD",
      "scheduled_date": "2049-04-23",
      "payment_method": "Credit Card",
      "status": "Completed",
      "result": "Ad-Hoc Payment",
      "records": [
        {
          "authorization": "389768",
          "id": "071-P-245JAGI0",
          "card_number": "400555XXXXXX0001",
          "card_holder": "Joe Bloggs",
          "card_expiry": "2023-05-31",
          "card_token": "fke8tr3e",
          "card_type": "VISA",
          "card_category": "Credit",
          "card_subcategory": "Standard",
          "amount": 123,
          "decimal_amount": 1.23,
          "successful": true,
          "message": "Approved",
          "reference": "PPAPI-001-0400",
          "currency": "AUD",
          "transaction_id": "071-P-245JAGI0",
          "settlement_date": "2018-09-07",
          "transaction_date": "2018-09-07T17:06:00+10:00",
          "response_code": "00",
          "captured": true,
          "captured_amount": 123,
          "rrn": "071P245JAGI0",
          "cvv_match": "M",
          "metadata": {},
          "addendum_data": {}
        }
      ]
    }
  }
}
{
  {
    "event": "payment_plan_payment:declined",
    "payload": {
      "id": "787-PT-G1EBHXZR",
      "payment_plan": "787-PP-4745AS4X",
      "reference": "PPAPI-001-0400",
      "amount": 10,
      "currency": "AUD",
      "scheduled_date": "2049-04-23",
      "payment_method": "Credit Card",
      "status": "Declined",
      "result": "Insufficient Funds",
      "records": []
    }
  }
}
{
  {
    "event": "payment_plan_payment:error",
    "payload": {
      "id": "787-PT-G1EBHXZR",
      "payment_plan": "787-PP-4745AS4X",
      "reference": "PPAPI-001-0400",
      "amount": 10,
      "currency": "AUD",
      "scheduled_date": "2049-04-23",
      "payment_method": "Credit Card",
      "status": "Error",
      "result": "Host or Issuer Unavailable",
      "records": []
    }
  }
}

Disputes

{
  "event": "dispute:opened",
  "payload": {
    "id": "001-P-3V8QW1BR",
    "reference": "MERCHREF-001",
    "dispute_reference": "ABC-123939847589437123412342320221205",
    "status": "open",
    "opened_on": "2022-12-06",
    "reason_code": "4387",
    "reason_description": "Card Not Present (fraud)",
    "amount_cents": 10000,
    "amount_currency": "AUD",
    "next_due_date": "2022-12-20"
  }
}
{
  "event": "dispute:status_changed",
  "payload": {
    "id": "001-P-3V8QW1BR",
    "reference": "MERCHREF-001",
    "dispute_reference": "ABC-123939847589437123412342320221205",
    "status": "lost",
    "last_status": "open"
  }
}

Card Account

{  
  "event": "card_account:update",
  "payload": {
    "token": "abcd1234abcd",
    "card_number": "555555XXXXXX1243",
    "card_expiry": "2021-09-30",
    "card_type": "MasterCard",
    "card_category": "Credit",
    "card_updater_status": "active"
  }
}