Skip to content
This repository has been archived by the owner on Dec 2, 2019. It is now read-only.

Commit

Permalink
2.1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
nozzlegear committed Nov 14, 2016
1 parent 10f563a commit 2c4bcf8
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ This library is still pretty new. It currently suppports the following Shopify A
- [Webhooks](#webhooks)
- [Script Tags](#script-tags)
- [Orders](#orders)
- [Application Credits](#application-credits)

More functionality will be added each week until it reachs full parity with Shopify's REST API.

Expand Down Expand Up @@ -655,4 +656,57 @@ import { Orders } from "shopify-prime";

const service = new Orders(shopDomain, shopAccessToken);
const order = await service.open(id);
```

### Canceling an Order

```js
import { Orders } from "shopify-prime";

const service = new Orders(shopDomain, shopAccessToken);

await service.cancel(id, {
reason: "customer"
});
```

## Application Credits

Shopify's Application Credit API lets you offer credits for payments your app customers have made via the Application Charge, Recurring Application Charge, and Usage Charge APIs.

The total amount of all Application Credits created by an application must not exceed:

1. Total amount paid to the application by the shop owner in the last 30 days.
2. Total amount of pending receivables in the partner account associated with the application.

Additionally, Application Credits cannot be used by private applications.

### Creating an Application Credit

```js
const { ApplicationCredits } from "shopify-prime";

const service = new ApplicationCredits(shopDomain, shopAccessToken);
const credit = await service.create({
description: "Refund for Foo",
amount: 10.00
});
```

### Getting an Application Credit

```js
const { ApplicationCredits } from "shopify-prime";

const service = new ApplicationCredits(shopDomain, shopAccessToken);
const credit = await service.get(id);
```

### Listing Application Credits

```js
const { ApplicationCredits } from "shopify-prime";

const service = new ApplicationCredits(shopDomain, shopAccessToken);
const credits = await service.list();
```
2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shopify-prime",
"version": "2.0.0",
"version": "2.1.0",
"description": "Shopify Prime is a NodeJS library built to help developers easily authenticate and make calls against the Shopify API. It was inspired by and borrows heavily from ShopifySharp.",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down

0 comments on commit 2c4bcf8

Please sign in to comment.