# orders_v3

OrdersV3 - JavaScript client for orders_v3
- [OAuth Scopes](#oauth-scopes) - [Authentication](#authentication) - [Available Endpoints](#available-endpoints) - [Order Transactions](#order-transactions) - [Resources](#resources)  The V3 REST API's Orders resource surfaces endpoints related to payment processing. The `/orders/{id}/transactions` endpoint returns transaction details for the specified order. To programmatically create, update, and delete orders themselves, see [Orders v2](https://developer.bigcommerce.com/api-reference/store-management/orders). To process payments, see [Payment Processing](https://developer.bigcommerce.com/api-reference/payments/payments-process-payments).  ## OAuth Scopes | UI Name| Permission |Parameter|                                      |----------------------------------------------|------------|-----------------------------------------------| | Order Transactions|modify|`store_v2_transactions`| | Order Transactions|read-only  |`store_v2_transactions_read_only`| | Orders| modify|`store_v2_orders`| | Orders| read-only|`store_v2_orders_read_only`|  For more information on OAuth Scopes, see: [Authentication](https://developer.bigcommerce.com/api-docs/getting-started/authentication).  ## Authentication Requests can be authenticated by sending a `client_id` and `access_token` via `X-Auth-Client` and `X-Auth-Token` HTTP headers:  ```http GET /stores/{$$.env.store_hash}/v3/catalog/summary host: api.bigcommerce.com Accept: application/json X-Auth-Client: {client_id} X-Auth-Token: {access_token} ```  |Header|Parameter|Description| |-|-|-| |`X-Auth-Client`|`client_id`|Obtained by creating an API account or installing an app in a BigCommerce control panel.| |`X-Auth-Token`|`access_token `|Obtained by creating an API account or installing an app in a BigCommerce control panel.|  For more information on Authenticating BigCommerce APIs, see: [Authentication](https://developer.bigcommerce.com/api-docs/getting-started/authentication).  ## Available Endpoints | Endpoint|Description|Reference |---|---|---| | `/orders/{id}/transactions`             | Get list of transaction data for an order|[Get Transactions](https://developer.bigcommerce.com/api-reference/store-management/order-transactions/transactions/gettransactions) |`/orders/{id}/payment_actions/refund_quotes`|` POST` - Create refund quote for order ID `{id}`.|[Create a Refund Quote](https://developer.bigcommerce.com/api-reference/store-management/order-transactions/order-refunds/postrefundquote) |`/orders/{id}/payment_actions/refunds`|`POST` Create a refund for order ID `{id}`.|[Create a Refund](https://developer.bigcommerce.com/api-reference/store-management/order-transactions/order-refunds/postrefund) |`/orders/{id}/payment_actions/refunds`|` GET` - Returns the refunds for order ID `{id}`.|[Get Refunds For Order](https://developer.bigcommerce.com/api-reference/store-management/order-transactions/order-refunds/getorderrefunds) |`/orders/payment_actions/refunds`|`GET` - Returns a list of refunds ordered by refund ID.|[Get All Refunds](https://developer.bigcommerce.com/api-reference/store-management/order-transactions/order-refunds/getrefunds)  ## Order Transactions The `/orders/{id}/transactions` endpoint returns details about the payment instruments used to pay for an order. Depending on the payment method used, different details will be available. Not all credit card payment gateways return full card or fraud details. Transactions endpoints are primarily used to get detailed gateway response information for credit card transactions; however they will also return any available information about digital wallet and offline payments.   **Note**: transactions are not created for the following payment methods: * Test Payment Gateway * PayPal Express * Amazon Pay  ## Order Refunds The Order API refund endpoints allow developers to process refunds against orders with settled payments. Refund endpoints are useful when building order management or payment integrations. They make embedding refund functionality directly into the application possible without requiring merchants to return to their BigCommerce Control Panel.  ## Resources * [Orders Overview](https://developer.bigcommerce.com/api-docs/orders/orders-overview) * [Orders V2](https://developer.bigcommerce.com/api-reference/store-management/orders)
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: 3.0
- Package version: 3.0
- Build package: io.swagger.codegen.v3.generators.javascript.JavaScriptClientCodegen

## Installation

### For [Node.js](https://nodejs.org/)

#### npm

To publish the library as a [npm](https://www.npmjs.com/),
please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).

Then install it via:

```shell
npm install orders_v3 --save
```

#### git
#
If the library is hosted at a git repository, e.g.
https://github.com/GIT_USER_ID/GIT_REPO_ID
then install it via:

```shell
    npm install GIT_USER_ID/GIT_REPO_ID --save
```

### For browser

The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
the above steps with Node.js and installing browserify with `npm install -g browserify`,
perform the following (assuming *main.js* is your entry file):

```shell
browserify main.js > bundle.js
```

Then include *bundle.js* in the HTML pages.

### Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error:
Cannot resolve module", most certainly you should disable AMD loader. Add/merge
the following section to your webpack config:

```javascript
module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}
```

## Getting Started

Please follow the [installation](#installation) instruction and execute the following JS code:

```javascript
var OrdersV3 = require('orders_v3');
var defaultClient = OrdersV3.ApiClient.instance;

// Configure API key authorization: X-Auth-Client
var X-Auth-Client = defaultClient.authentications['X-Auth-Client'];
X-Auth-Client.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//X-Auth-Client.apiKeyPrefix['X-Auth-Client'] = "Token"

// Configure API key authorization: X-Auth-Token
var X-Auth-Token = defaultClient.authentications['X-Auth-Token'];
X-Auth-Token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//X-Auth-Token.apiKeyPrefix['X-Auth-Token'] = "Token"

var api = new OrdersV3.OrderRefundsApi()
var orderId = "orderId_example"; // {String} 
var opts = { 
  'accept': "application/json", // {String} 
  'contentType': "application/json" // {String} 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getorderrefunds(orderId, opts, callback);
```

## Documentation for API Endpoints

All URIs are relative to *https://api.bigcommerce.com/stores/{$$.env.store_hash}/v3*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*OrdersV3.OrderRefundsApi* | [**getorderrefunds**](docs/OrderRefundsApi.md#getorderrefunds) | **GET** /orders/{order_id}/payment_actions/refunds | Get Refunds for Order
*OrdersV3.OrderRefundsApi* | [**postrefund**](docs/OrderRefundsApi.md#postrefund) | **POST** /orders/{order_id}/payment_actions/refunds | Create a Refund
*OrdersV3.OrderRefundsApi* | [**postrefundquote**](docs/OrderRefundsApi.md#postrefundquote) | **POST** /orders/{order_id}/payment_actions/refund_quotes | Create a Refund Quote
*OrdersV3.TransactionsApi* | [**getTransactions**](docs/TransactionsApi.md#getTransactions) | **GET** /orders/{order_id}/transactions | Get Transactions

## Documentation for Models

 - [OrdersV3.AVSResult](docs/AVSResult.md)
 - [OrdersV3.AVSResults](docs/AVSResults.md)
 - [OrdersV3.AllOfinlineResponse200DataItems](docs/AllOfinlineResponse200DataItems.md)
 - [OrdersV3.Amount](docs/Amount.md)
 - [OrdersV3.AmountBoundItem](docs/AmountBoundItem.md)
 - [OrdersV3.BatchOperationMeta](docs/BatchOperationMeta.md)
 - [OrdersV3.CVVResult](docs/CVVResult.md)
 - [OrdersV3.CollectionMeta](docs/CollectionMeta.md)
 - [OrdersV3.CreateReturn](docs/CreateReturn.md)
 - [OrdersV3.CreateReturnCustomer](docs/CreateReturnCustomer.md)
 - [OrdersV3.CreateReturnItems](docs/CreateReturnItems.md)
 - [OrdersV3.CreateReturnPreferredOutcome](docs/CreateReturnPreferredOutcome.md)
 - [OrdersV3.CreateReturnReason](docs/CreateReturnReason.md)
 - [OrdersV3.CreateReturnReceivedState](docs/CreateReturnReceivedState.md)
 - [OrdersV3.CreateReturnRequest](docs/CreateReturnRequest.md)
 - [OrdersV3.CreateReturnRequestItem](docs/CreateReturnRequestItem.md)
 - [OrdersV3.CreateReturnRequestItems](docs/CreateReturnRequestItems.md)
 - [OrdersV3.CreateReturnRequestReferenceId](docs/CreateReturnRequestReferenceId.md)
 - [OrdersV3.CreateReturnReviewState](docs/CreateReturnReviewState.md)
 - [OrdersV3.CreditCard](docs/CreditCard.md)
 - [OrdersV3.Custom](docs/Custom.md)
 - [OrdersV3.Custom1](docs/Custom1.md)
 - [OrdersV3.DetailedErrors](docs/DetailedErrors.md)
 - [OrdersV3.ErrorBase](docs/ErrorBase.md)
 - [OrdersV3.ErrorDetailedFull](docs/ErrorDetailedFull.md)
 - [OrdersV3.ErrorResponse](docs/ErrorResponse.md)
 - [OrdersV3.ErrorResponse1](docs/ErrorResponse1.md)
 - [OrdersV3.FailedQuoteError](docs/FailedQuoteError.md)
 - [OrdersV3.FailedQuoteError1](docs/FailedQuoteError1.md)
 - [OrdersV3.GetReturnableItems](docs/GetReturnableItems.md)
 - [OrdersV3.GetReturnableItemsInner](docs/GetReturnableItemsInner.md)
 - [OrdersV3.GetReturnsSettings](docs/GetReturnsSettings.md)
 - [OrdersV3.GetReturnsSettingsPreferredOutcomes](docs/GetReturnsSettingsPreferredOutcomes.md)
 - [OrdersV3.GetReturnsSettingsReasons](docs/GetReturnsSettingsReasons.md)
 - [OrdersV3.GiftCertificate](docs/GiftCertificate.md)
 - [OrdersV3.InlineResponse200](docs/InlineResponse200.md)
 - [OrdersV3.InlineResponse2001](docs/InlineResponse2001.md)
 - [OrdersV3.InlineResponse201](docs/InlineResponse201.md)
 - [OrdersV3.InlineResponse2011](docs/InlineResponse2011.md)
 - [OrdersV3.InlineResponse503](docs/InlineResponse503.md)
 - [OrdersV3.ItemReferenceId](docs/ItemReferenceId.md)
 - [OrdersV3.ItemsRefund](docs/ItemsRefund.md)
 - [OrdersV3.LinksFull](docs/LinksFull.md)
 - [OrdersV3.LinksFull1](docs/LinksFull1.md)
 - [OrdersV3.Meta](docs/Meta.md)
 - [OrdersV3.Meta1](docs/Meta1.md)
 - [OrdersV3.MetaCollectionFull](docs/MetaCollectionFull.md)
 - [OrdersV3.MetaCollectionFull1](docs/MetaCollectionFull1.md)
 - [OrdersV3.MetaEmptyFull](docs/MetaEmptyFull.md)
 - [OrdersV3.MetaRefund](docs/MetaRefund.md)
 - [OrdersV3.NoContent](docs/NoContent.md)
 - [OrdersV3.NotFound](docs/NotFound.md)
 - [OrdersV3.Offline](docs/Offline.md)
 - [OrdersV3.Offline1](docs/Offline1.md)
 - [OrdersV3.Pagination](docs/Pagination.md)
 - [OrdersV3.Pagination1](docs/Pagination1.md)
 - [OrdersV3.PaginationFull](docs/PaginationFull.md)
 - [OrdersV3.PaginationFull1](docs/PaginationFull1.md)
 - [OrdersV3.PaginationLinks](docs/PaginationLinks.md)
 - [OrdersV3.PaymentOption](docs/PaymentOption.md)
 - [OrdersV3.PaymentRequest](docs/PaymentRequest.md)
 - [OrdersV3.PostRefundQuotesRequest](docs/PostRefundQuotesRequest.md)
 - [OrdersV3.PostRefundsRequest](docs/PostRefundsRequest.md)
 - [OrdersV3.PreferredOutcome](docs/PreferredOutcome.md)
 - [OrdersV3.Problem](docs/Problem.md)
 - [OrdersV3.QuantityBoundItem](docs/QuantityBoundItem.md)
 - [OrdersV3.Reason](docs/Reason.md)
 - [OrdersV3.ReceivedItemsBase](docs/ReceivedItemsBase.md)
 - [OrdersV3.ReceivedItemsBaseInner](docs/ReceivedItemsBaseInner.md)
 - [OrdersV3.ReceivedItemsPut](docs/ReceivedItemsPut.md)
 - [OrdersV3.ReceivedItemsPutInner](docs/ReceivedItemsPutInner.md)
 - [OrdersV3.Refund](docs/Refund.md)
 - [OrdersV3.Refund1](docs/Refund1.md)
 - [OrdersV3.RefundItem](docs/RefundItem.md)
 - [OrdersV3.RefundMethod](docs/RefundMethod.md)
 - [OrdersV3.RefundPayment](docs/RefundPayment.md)
 - [OrdersV3.RefundQuoteFull](docs/RefundQuoteFull.md)
 - [OrdersV3.RefundQuoteFull1](docs/RefundQuoteFull1.md)
 - [OrdersV3.RefundQuotePost](docs/RefundQuotePost.md)
 - [OrdersV3.RefundQuotePost1](docs/RefundQuotePost1.md)
 - [OrdersV3.RefundRequestPost](docs/RefundRequestPost.md)
 - [OrdersV3.RefundRequestPost1](docs/RefundRequestPost1.md)
 - [OrdersV3.RefundRequestPost2](docs/RefundRequestPost2.md)
 - [OrdersV3.ReturnFull](docs/ReturnFull.md)
 - [OrdersV3.ReturnItem](docs/ReturnItem.md)
 - [OrdersV3.ReviewedItemsBase](docs/ReviewedItemsBase.md)
 - [OrdersV3.ReviewedItemsBaseInner](docs/ReviewedItemsBaseInner.md)
 - [OrdersV3.ReviewedItemsPut](docs/ReviewedItemsPut.md)
 - [OrdersV3.ReviewedItemsPutInner](docs/ReviewedItemsPutInner.md)
 - [OrdersV3.StatusFull](docs/StatusFull.md)
 - [OrdersV3.StatusUpdateFull](docs/StatusUpdateFull.md)
 - [OrdersV3.StatusUpdateFull1](docs/StatusUpdateFull1.md)
 - [OrdersV3.StoreCredit](docs/StoreCredit.md)
 - [OrdersV3.TaxExemptItem](docs/TaxExemptItem.md)
 - [OrdersV3.Transaction](docs/Transaction.md)
 - [OrdersV3.TransactionPost](docs/TransactionPost.md)
 - [OrdersV3.TransactionStoreCredit](docs/TransactionStoreCredit.md)
 - [OrdersV3.UpdateReturnStatuses](docs/UpdateReturnStatuses.md)
 - [OrdersV3.UpdateReturnStatusesInner](docs/UpdateReturnStatusesInner.md)
 - [OrdersV3.UpdateReturnStatusesRequest](docs/UpdateReturnStatusesRequest.md)

## Documentation for Authorization


### X-Auth-Client

- **Type**: API key
- **API key parameter name**: X-Auth-Client
- **Location**: HTTP header

### X-Auth-Token

- **Type**: API key
- **API key parameter name**: X-Auth-Token
- **Location**: HTTP header

