List refunds for a transaction.
package main
import(
"context"
"os"
gr4vygo "github.com/gr4vy/gr4vy-go"
"log"
)
func main() {
ctx := context.Background()
s := gr4vygo.New(
gr4vygo.WithMerchantAccountID("default"),
gr4vygo.WithSecurity(os.Getenv("GR4VY_BEARER_AUTH")),
)
res, err := s.Transactions.Refunds.List(ctx, "7099948d-7286-47e4-aad8-b68f7eb44591")
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
transactionID |
string |
✔️ | The ID of the transaction | 7099948d-7286-47e4-aad8-b68f7eb44591 |
merchantAccountID |
*string |
➖ | The ID of the merchant account to use for this request. | |
opts |
[]operations.Option | ➖ | The options for this request. |
*components.Refunds, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.Error400 | 400 | application/json |
| apierrors.Error401 | 401 | application/json |
| apierrors.Error403 | 403 | application/json |
| apierrors.Error404 | 404 | application/json |
| apierrors.Error405 | 405 | application/json |
| apierrors.Error409 | 409 | application/json |
| apierrors.HTTPValidationError | 422 | application/json |
| apierrors.Error425 | 425 | application/json |
| apierrors.Error429 | 429 | application/json |
| apierrors.Error500 | 500 | application/json |
| apierrors.Error502 | 502 | application/json |
| apierrors.Error504 | 504 | application/json |
| apierrors.APIError | 4XX, 5XX | */* |
Create a refund for a transaction.
package main
import(
"context"
"os"
gr4vygo "github.com/gr4vy/gr4vy-go"
"github.com/gr4vy/gr4vy-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := gr4vygo.New(
gr4vygo.WithMerchantAccountID("default"),
gr4vygo.WithSecurity(os.Getenv("GR4VY_BEARER_AUTH")),
)
res, err := s.Transactions.Refunds.Create(ctx, "7099948d-7286-47e4-aad8-b68f7eb44591", components.TransactionRefundCreate{}, nil)
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
transactionID |
string |
✔️ | The ID of the transaction | 7099948d-7286-47e4-aad8-b68f7eb44591 |
transactionRefundCreate |
components.TransactionRefundCreate | ✔️ | N/A | |
merchantAccountID |
*string |
➖ | The ID of the merchant account to use for this request. | |
idempotencyKey |
*string |
➖ | A unique key that identifies this request. Providing this header will make this an idempotent request. We recommend using V4 UUIDs, or another random string with enough entropy to avoid collisions. | request-12345 |
opts |
[]operations.Option | ➖ | The options for this request. |
*components.Refund, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.Error400 | 400 | application/json |
| apierrors.Error401 | 401 | application/json |
| apierrors.Error403 | 403 | application/json |
| apierrors.Error404 | 404 | application/json |
| apierrors.Error405 | 405 | application/json |
| apierrors.Error409 | 409 | application/json |
| apierrors.HTTPValidationError | 422 | application/json |
| apierrors.Error425 | 425 | application/json |
| apierrors.Error429 | 429 | application/json |
| apierrors.Error500 | 500 | application/json |
| apierrors.Error502 | 502 | application/json |
| apierrors.Error504 | 504 | application/json |
| apierrors.APIError | 4XX, 5XX | */* |
Fetch refund for a transaction.
package main
import(
"context"
"os"
gr4vygo "github.com/gr4vy/gr4vy-go"
"log"
)
func main() {
ctx := context.Background()
s := gr4vygo.New(
gr4vygo.WithMerchantAccountID("default"),
gr4vygo.WithSecurity(os.Getenv("GR4VY_BEARER_AUTH")),
)
res, err := s.Transactions.Refunds.Get(ctx, "7099948d-7286-47e4-aad8-b68f7eb44591", "6a1d4e46-14ed-4fe1-a45f-eff4e025d211")
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
transactionID |
string |
✔️ | The ID of the transaction | 7099948d-7286-47e4-aad8-b68f7eb44591 |
refundID |
string |
✔️ | The ID of the refund | 6a1d4e46-14ed-4fe1-a45f-eff4e025d211 |
merchantAccountID |
*string |
➖ | The ID of the merchant account to use for this request. | |
opts |
[]operations.Option | ➖ | The options for this request. |
*components.Refund, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.Error400 | 400 | application/json |
| apierrors.Error401 | 401 | application/json |
| apierrors.Error403 | 403 | application/json |
| apierrors.Error404 | 404 | application/json |
| apierrors.Error405 | 405 | application/json |
| apierrors.Error409 | 409 | application/json |
| apierrors.HTTPValidationError | 422 | application/json |
| apierrors.Error425 | 425 | application/json |
| apierrors.Error429 | 429 | application/json |
| apierrors.Error500 | 500 | application/json |
| apierrors.Error502 | 502 | application/json |
| apierrors.Error504 | 504 | application/json |
| apierrors.APIError | 4XX, 5XX | */* |