Skip to content

Commit

Permalink
decoupling credits and refunds
Browse files Browse the repository at this point in the history
  • Loading branch information
erikmarr committed Aug 23, 2019
1 parent a26267c commit 87fd13c
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 31 deletions.
10 changes: 8 additions & 2 deletions _data/toc/rest-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,15 @@ pages:
- label: Manage prices for multiple products
url: /rest/modules/catalog-pricing.html
include_versions: ["2.2", "2.3"]

- label: Sales
children:

- label: Credits
url: /rest/modules/credits.html

- label: Refunds and credits
url: /rest/modules/refunds-credits.html
- label: Refunds
url: /rest/modules/refunds.html

- label: Inventory
include_versions: ["2.3"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,12 @@
---
group: rest-api
title: Refunds and credits
title: Credits
functional_areas:
- Integration
- Catalog
---

There are several options to choose when issuing a refund or credit using the Magento Refund API.

## salesRefundInvoiceV1 service

With this service, you can initiate and process a refund based on an Invoice ID, created using an online payment method.

### Endpoint

`POST V1/invoice/:invoiceId/refund`

{:.bs-callout-warning}
If you try to apply the service to an invoice created using an offline payment method, the system will display a validation error.

The `salesRefundInvoice` service allows you to:

* Create a credit memo (complete or partial) for an invoice
* Add details about the refunded items to the order
* Change status and state of an order according to performed actions
* Notify a customer about the performed refund operation
* Designate whether the returned items are returned to stock

## salesRefundOrderV1 service

This service performs the same operations as the `RefundInvoice` service, but based on an Order ID. Use this service if the invoice was created using an offline payment method.

### Endpoint

`POST V1/order/:orderId/refund`
There are several options to choose when issuing a credit using the Magento Refund API.

## salesCreditmemoManagement service

Expand Down
40 changes: 40 additions & 0 deletions guides/v2.2/rest/modules/sales/refunds.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
group: rest-api
title: Refunds
functional_areas:
- Integration
- Catalog
---

There are several options to choose when issuing a refund using the Magento Refund API.

## salesRefundInvoiceV1 service

With this service, you can initiate and process a refund based on an Invoice ID, created using an online payment method.

### Endpoint

`POST V1/invoice/:invoiceId/refund`

{:.bs-callout-warning}
If you try to apply the service to an invoice created using an offline payment method, the system will display a validation error.

The `salesRefundInvoice` service allows you to:

* Create a credit memo (complete or partial) for an invoice
* Add details about the refunded items to the order
* Change status and state of an order according to performed actions
* Notify a customer about the performed refund operation
* Designate whether the returned items are returned to stock

## salesRefundOrderV1 service

This service performs the same operations as the `RefundInvoice` service, but based on an Order ID. Use this service if the invoice was created using an offline payment method.

### Endpoint

`POST V1/order/:orderId/refund`

## Related documentation

* [Magento REST API documentation (Swagger)](https://devdocs.magento.com/swagger/index.html)

0 comments on commit 87fd13c

Please sign in to comment.