(refunds())
Refunds are reimbursements for successfully created but unused shipping labels or other charges.
- create - Create a refund
- list - List all refunds
- get - Retrieve a refund
Creates a new refund object.
package hello.world;
import com.goshippo.shippo_sdk.Shippo;
import com.goshippo.shippo_sdk.models.components.RefundRequestBody;
import com.goshippo.shippo_sdk.models.operations.CreateRefundResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Shippo sdk = Shippo.builder()
.apiKeyHeader("<YOUR_API_KEY_HERE>")
.shippoApiVersion("2018-02-08")
.build();
CreateRefundResponse res = sdk.refunds().create()
.shippoApiVersion("2018-02-08")
.refundRequestBody(RefundRequestBody.builder()
.transaction("915d94940ea54c3a80cbfa328722f5a1")
.async(false)
.build())
.call();
if (res.refund().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
Example |
shippoApiVersion |
Optional<String> |
➖ |
Optional string used to pick a non-default API version to use. See our API version guide. |
2018-02-08 |
refundRequestBody |
RefundRequestBody |
✔️ |
Refund details |
|
CreateRefundResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |
Returns a list all refund objects.
package hello.world;
import com.goshippo.shippo_sdk.Shippo;
import com.goshippo.shippo_sdk.models.operations.ListRefundsResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Shippo sdk = Shippo.builder()
.apiKeyHeader("<YOUR_API_KEY_HERE>")
.shippoApiVersion("2018-02-08")
.build();
ListRefundsResponse res = sdk.refunds().list()
.shippoApiVersion("2018-02-08")
.call();
if (res.refundPaginatedList().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
Example |
shippoApiVersion |
Optional<String> |
➖ |
Optional string used to pick a non-default API version to use. See our API version guide. |
2018-02-08 |
ListRefundsResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |
Returns an existing rate using a rate object ID.
package hello.world;
import com.goshippo.shippo_sdk.Shippo;
import com.goshippo.shippo_sdk.models.operations.GetRefundResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Shippo sdk = Shippo.builder()
.apiKeyHeader("<YOUR_API_KEY_HERE>")
.shippoApiVersion("2018-02-08")
.build();
GetRefundResponse res = sdk.refunds().get()
.refundId("<id>")
.shippoApiVersion("2018-02-08")
.call();
if (res.refund().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
Example |
refundId |
String |
✔️ |
Object ID of the refund to update |
|
shippoApiVersion |
Optional<String> |
➖ |
Optional string used to pick a non-default API version to use. See our API version guide. |
2018-02-08 |
GetRefundResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |