Skip to content

Latest commit

 

History

History
71 lines (52 loc) · 3.78 KB

File metadata and controls

71 lines (52 loc) · 3.78 KB

Refunds

Overview

Available Operations

  • get - Get refund

get

Fetch a refund.

Example Usage

package hello.world;

import com.gr4vy.sdk.Gr4vy;
import com.gr4vy.sdk.models.errors.*;
import com.gr4vy.sdk.models.operations.GetRefundResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        Gr4vy sdk = Gr4vy.builder()
                .merchantAccountId("default")
                .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
            .build();

        GetRefundResponse res = sdk.refunds().get()
                .refundId("6a1d4e46-14ed-4fe1-a45f-eff4e025d211")
                .call();

        if (res.refund().isPresent()) {
            System.out.println(res.refund().get());
        }
    }
}

Parameters

Parameter Type Required Description Example
refundId String ✔️ The ID of the refund 6a1d4e46-14ed-4fe1-a45f-eff4e025d211
merchantAccountId JsonNullable<String> The ID of the merchant account to use for this request.

Response

GetRefundResponse

Errors

Error Type Status Code Content Type
models/errors/Error400 400 application/json
models/errors/Error401 401 application/json
models/errors/Error403 403 application/json
models/errors/Error404 404 application/json
models/errors/Error405 405 application/json
models/errors/Error409 409 application/json
models/errors/HTTPValidationError 422 application/json
models/errors/Error425 425 application/json
models/errors/Error429 429 application/json
models/errors/Error500 500 application/json
models/errors/Error502 502 application/json
models/errors/Error504 504 application/json
models/errors/APIException 4XX, 5XX */*