-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
220 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Newtonsoft.Json; | ||
using EasyPost; | ||
using EasyPost.Models.API; | ||
|
||
namespace EasyPostExamples | ||
{ | ||
public class Examples | ||
{ | ||
public static async Task Main() | ||
{ | ||
var client = new EasyPost.Client("EASYPOST_API_KEY"); | ||
|
||
Insurance insurance = await client.Insurance.Refund("ins_..."); | ||
|
||
Console.WriteLine(JsonConvert.SerializeObject(insurance, Formatting.Indented)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
curl -X POST https://api.easypost.com/v2/insurances/ins_.../refund \ | ||
-u "EASYPOST_API_KEY": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package example | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/EasyPost/easypost-go/v3" | ||
) | ||
|
||
func main() { | ||
client := easypost.New("EASYPOST_API_KEY") | ||
|
||
insurance, _ := client.RefundInsurance("ins_...") | ||
|
||
fmt.Println(insurance) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package insurances; | ||
|
||
import com.easypost.exception.EasyPostException; | ||
import com.easypost.model.Insurance; | ||
import com.easypost.service.EasyPostClient; | ||
|
||
public class Retrieve { | ||
public static void main(String[] args) throws EasyPostException { | ||
EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY"); | ||
|
||
Insurance insurance = client.insurance.refund("ins_..."); | ||
|
||
System.out.println(insurance); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const EasyPostClient = require('@easypost/api'); | ||
|
||
const client = new EasyPostClient('EASYPOST_API_KEY'); | ||
|
||
(async () => { | ||
const insurance = await client.Insurance.refund('ins_...'); | ||
|
||
console.log(insurance); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
$client = new \EasyPost\EasyPostClient('EASYPOST_API_KEY'); | ||
|
||
$insurance = $client->insurance->refund('ins_...'); | ||
|
||
echo $insurance; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import easypost | ||
|
||
client = easypost.EasyPostClient("EASYPOST_API_KEY") | ||
|
||
insurance = client.insurance.refund("ins_...") | ||
|
||
print(insurance) |
136 changes: 136 additions & 0 deletions
136
official/docs/responses/insurance/insurance-refund.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
{ | ||
"id": "ins_2500e29183a64136b84a1e44ff08905f", | ||
"object": "Insurance", | ||
"mode": "test", | ||
"reference": null, | ||
"status": "cancelled", | ||
"amount": "100.00000", | ||
"provider": "easypost", | ||
"provider_id": null, | ||
"to_address": { | ||
"id": "adr_568c1ebcba4c11ee96cd3cecef1b359e", | ||
"object": "Address", | ||
"created_at": "2024-01-24T00:05:52+00:00", | ||
"updated_at": "2024-01-24T00:05:52+00:00", | ||
"name": "DR. STEVE BRULE", | ||
"company": null, | ||
"street1": "179 N HARBOR DR", | ||
"street2": null, | ||
"city": "REDONDO BEACH", | ||
"state": "CA", | ||
"zip": "90277-2506", | ||
"country": "US", | ||
"phone": "8573875756", | ||
"email": "[email protected]", | ||
"mode": "test", | ||
"carrier_facility": null, | ||
"residential": false, | ||
"federal_tax_id": null, | ||
"state_tax_id": null, | ||
"verifications": { | ||
"zip4": { | ||
"success": true, | ||
"errors": [], | ||
"details": null | ||
}, | ||
"delivery": { | ||
"success": true, | ||
"errors": [], | ||
"details": { | ||
"latitude": 33.8436, | ||
"longitude": -118.39177, | ||
"time_zone": "America/Los_Angeles" | ||
} | ||
} | ||
} | ||
}, | ||
"from_address": { | ||
"id": "adr_56912a8aba4c11ee96cf3cecef1b359e", | ||
"object": "Address", | ||
"created_at": "2024-01-24T00:05:52+00:00", | ||
"updated_at": "2024-01-24T00:05:52+00:00", | ||
"name": "EASYPOST", | ||
"company": null, | ||
"street1": "417 MONTGOMERY ST # 5", | ||
"street2": null, | ||
"city": "SAN FRANCISCO", | ||
"state": "CA", | ||
"zip": "94104-1129", | ||
"country": "US", | ||
"phone": "4153334445", | ||
"email": "[email protected]", | ||
"mode": "test", | ||
"carrier_facility": null, | ||
"residential": false, | ||
"federal_tax_id": null, | ||
"state_tax_id": null, | ||
"verifications": { | ||
"zip4": { | ||
"success": true, | ||
"errors": [], | ||
"details": null | ||
}, | ||
"delivery": { | ||
"success": true, | ||
"errors": [], | ||
"details": { | ||
"latitude": 37.79342, | ||
"longitude": -122.40288, | ||
"time_zone": "America/Los_Angeles" | ||
} | ||
} | ||
} | ||
}, | ||
"shipment_id": null, | ||
"tracker": { | ||
"id": "trk_48fb9b6e8270488397cabd1ee6feccd6", | ||
"object": "Tracker", | ||
"mode": "test", | ||
"tracking_code": "9400110898825022579493", | ||
"status": "error", | ||
"status_detail": null, | ||
"created_at": "2024-01-24T00:05:52Z", | ||
"updated_at": "2024-01-24T00:05:52Z", | ||
"signed_by": null, | ||
"weight": null, | ||
"est_delivery_date": null, | ||
"shipment_id": null, | ||
"carrier": "USPS", | ||
"tracking_details": [ | ||
{ | ||
"object": "TrackingDetail", | ||
"message": "In test mode, only test tracking numbers are valid. Test tracking numbers are EZ1000000001, EZ2000000002, ... , EZ7000000007", | ||
"description": "", | ||
"status": "error", | ||
"status_detail": null, | ||
"datetime": "2024-01-24T00:05:52Z", | ||
"source": "ProcessingError", | ||
"carrier_code": "", | ||
"tracking_location": { | ||
"object": "TrackingLocation", | ||
"city": null, | ||
"state": null, | ||
"country": null, | ||
"zip": null | ||
} | ||
} | ||
], | ||
"carrier_detail": null, | ||
"finalized": true, | ||
"is_return": false, | ||
"public_url": "https://track.easypost.com/djE6dHJrXzQ4ZmI5YjZlODI3MDQ4ODM5N2NhYmQxZWU2ZmVjY2Q2", | ||
"fees": [] | ||
}, | ||
"tracking_code": "9400110898825022579493", | ||
"fee": { | ||
"object": "Fee", | ||
"type": "InsuranceFee", | ||
"amount": "0.50000", | ||
"charged": true, | ||
"refunded": false | ||
}, | ||
"messages": [], | ||
"created_at": "2024-01-24T00:05:52Z", | ||
"updated_at": "2024-01-24T00:05:52Z" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'easypost' | ||
|
||
client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY') | ||
|
||
insurance = client.insurance.refund('ins_...') | ||
|
||
puts insurance |