Skip to content

Commit

Permalink
Add example to delete transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
brunomvsouza committed Feb 8, 2025
1 parent 64610ec commit c5cee68
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions api/transaction/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ func ExampleService_GetTransaction() {
// Output: *transaction.Transaction
}

func ExampleService_DeleteTransaction() {
c := ynab.NewClient("<valid_ynab_access_token>")
transactions, _ := c.Transaction().DeleteTransaction("<valid_budget_id>", "valid_transaction_id")
fmt.Println(reflect.TypeOf(transactions))

// Output: *transaction.Transaction
}

func ExampleService_GetTransactions() {
c := ynab.NewClient("<valid_ynab_access_token>")
transactions, _ := c.Transaction().GetTransactions("<valid_budget_id>", nil)
Expand Down

0 comments on commit c5cee68

Please sign in to comment.