Skip to content

Latest commit

 

History

History
135 lines (92 loc) · 11.7 KB

README.md

File metadata and controls

135 lines (92 loc) · 11.7 KB

Refunds

(Refunds)

Overview

Refunds are reimbursements for successfully created but unused shipping labels or other charges.

Available Operations

  • Create - Create a refund
  • List - List all refunds
  • Get - Retrieve a refund

Create

Creates a new refund object.

Example Usage

using Shippo;
using Shippo.Models.Requests;
using Shippo.Models.Components;

var sdk = new ShippoSDK(
    apiKeyHeader: "<YOUR_API_KEY_HERE>",
    shippoApiVersion: "2018-02-08"
);

var res = await sdk.Refunds.CreateAsync(
    refundRequestBody: new RefundRequestBody() {
        Async = false,
        Transaction = "915d94940ea54c3a80cbfa328722f5a1",
    },
    shippoApiVersion: "2018-02-08"
);

// handle response

Parameters

Parameter Type Required Description Example
RefundRequestBody RefundRequestBody ✔️ Refund details
ShippoApiVersion string Optional string used to pick a non-default API version to use. See our API version guide. 2018-02-08

Response

Refund

Errors

Error Type Status Code Content Type
Shippo.Models.Errors.SDKException 4XX, 5XX */*

List

Returns a list all refund objects.

Example Usage

using Shippo;
using Shippo.Models.Requests;
using Shippo.Models.Components;

var sdk = new ShippoSDK(
    apiKeyHeader: "<YOUR_API_KEY_HERE>",
    shippoApiVersion: "2018-02-08"
);

var res = await sdk.Refunds.ListAsync(shippoApiVersion: "2018-02-08");

// handle response

Parameters

Parameter Type Required Description Example
ShippoApiVersion string Optional string used to pick a non-default API version to use. See our API version guide. 2018-02-08

Response

RefundPaginatedList

Errors

Error Type Status Code Content Type
Shippo.Models.Errors.SDKException 4XX, 5XX */*

Get

Returns an existing rate using a rate object ID.

Example Usage

using Shippo;
using Shippo.Models.Requests;
using Shippo.Models.Components;

var sdk = new ShippoSDK(
    apiKeyHeader: "<YOUR_API_KEY_HERE>",
    shippoApiVersion: "2018-02-08"
);

var res = await sdk.Refunds.GetAsync(
    refundId: "<id>",
    shippoApiVersion: "2018-02-08"
);

// handle response

Parameters

Parameter Type Required Description Example
RefundId string ✔️ Object ID of the refund to update
ShippoApiVersion string Optional string used to pick a non-default API version to use. See our API version guide. 2018-02-08

Response

Refund

Errors

Error Type Status Code Content Type
Shippo.Models.Errors.SDKException 4XX, 5XX */*