Repository: VictorAvelar/mollie-api-go
Pull request #36 (2019-10-20 01:59:37)

Feature/implements orders api
<!--- Provide a general summary of your changes in the Title above -->

## Description

Implements Orders API

## Motivation and context

Fixes issue #12 

## How has this been tested?

The unit test is included in the source code

## Screenshots (if appropriate)

## Types of changes

What types of changes does your code introduce? Put an `x` in all the boxes that apply:
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Checklist:

Go over all the following points, and put an `x` in all the boxes that apply.

Please, please, please, don't send your pull request until all of the boxes are ticked. Once your pull request is created, it will trigger a build on our continuous integration server to make sure your [tests and code style pass](https://help.github.com/articles/about-required-status-checks/).

- [x] I have read the **[CONTRIBUTING](CONTRIBUTING.md)** document.
- [x] My pull request addresses exactly one patch/feature.
- [x] I have created a branch for this patch/feature.
- [x] Each individual commit in the pull request is meaningful.
- [x] I have added tests to cover my changes.
- [x] If my change requires a change to the documentation, I have updated it accordingly.

If you're unsure about any of these, don't hesitate to ask. We're here to help!



Patch:
diff --git a/docs/README.md b/docs/README.md
index 72ea9b9..44cb5b5 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -1672,3 +1672,397 @@ type UsedGiftCard struct {
 ```
 
 UsedGiftCard describes a used gift card.
+
+#### type Orders
+
+```go
+type Orders struct {
+	Resource            string         `json:"resource,omitempty"`
+	ID                  string         `json:"id,omitempty"`
+	ProfileID           string         `json:"profileId,omitempty"`
+	Method              *PaymentMethod `json:"method,omitempty"`
+	Mode                *Mode          `json:"mode,omitempty"`
+	Amount              *Amount        `json:"amount,omitempty"`
+	AmountCaptured      *Amount        `json:"amountCaptured,omitempty"`
+	AmountRefunded      *Amount        `json:"amountRefunded,omitempty"`
+	Status              *OrderStatus   `json:"status,omitempty"`
+	IsCancelable        bool           `json:"isCancelable,omitempty"`
+	BillingAddress      *OrderAddress  `json:"billingAddress,omitempty"`
+	ConsumerDateOfBirth *ShortDate     `json:"consumerDateOfBirth,omitempty"`
+	OrderNumber         string         `json:"orderNumber,omitempty"`
+	ShippingAddress     *OrderAddress  `json:"shippingAddress,omitempty"`
+	Locale              *Locale        `json:"locale,omitempty"`
+	Metadata            interface{}    `json:"metadata,omitempty"`
+	RedirectURL         string         `json:"redirectUrl,omitempty"`
+	Lines               []*OrderLines  `json:"lines,omitempty"`
+	WebhookURL          string         `json:"webhookUrl,omitempty"`
+	CreatedAt           *time.Time     `json:"createdAt,omitempty"`
+	ExpiresAt           *time.Time     `json:"expiresAt,omitempty"`
+	ExpiredAt           *time.Time     `json:"expiredAt,omitempty"`
+	PaidAt              *time.Time     `json:"paidAt,omitempty"`
+	AuthorizedAt        *time.Time     `json:"authorizedAt,omitempty"`
+	CanceledAt          *time.Time     `json:"canceledAt,omitempty"`
+	CompletedAt         *time.Time     `json:"completedAt,omitempty"`
+	Embedded            struct {
+		Payments []Payment `json:"payments,omitempty"`
+		Refunds  []Refund  `json:"refunds,omitempty"`
+	} `json:"_embedded,omitempty"`
+	Links        *OrderLinks   `json:"_links,omitempty"`
+	OrderPayment *OrderPayment `json:"payment,omitempty"`
+	Description  string        `json:"description,omitempty"`
+}
+```
+
+Orders explain the items that customers need to pay for.
+
+#### type OrderPayment
+
+```go
+type OrderPayment struct {
+	ConsumerAccount   string          `json:"consumerAccount,omitempty"`
+	CustomerID        string          `json:"customerId,omitempty"`
+	CustomerReference string          `json:"customerReference,omitempty"`
+	Issuer            string          `json:"issuer,omitempty"`
+	MandateID         string          `json:"mandateId,omitempty"`
+	SequenceType      *SequenceType   `json:"sequenceType,omitempty"`
+	VoucherNumber     string          `json:"voucherNumber,omitempty"`
+	VoucherPin        string          `json:"voucherPin,omitempty"`
+	WebhookURL        string          `json:"webhookUrl,omitempty"`
+	ApplicationFee    *ApplicationFee `json:"applicationFee,omitempty"`
+	Method            *PaymentMethod  `json:"method,omitempty"`
+}
+```
+
+OrderPayment describes payment specific parameters that can be passed during order creation
+
+#### type OrderStatus
+
+```go
+type OrderStatus string
+```
+
+OrderStatus describes the valid order status.
+
+#### const OrderStatus
+
+```go 
+const (
+	Created    OrderStatus = "created"
+	Paid       OrderStatus = "paid"
+	Authorized OrderStatus = "authorized"
+	Canceled   OrderStatus = "canceled"
+	Shipping   OrderStatus = "shipping"
+	Completed  OrderStatus = "completed"
+	Expired    OrderStatus = "expired"
+)
+```
+
+Valid order status.
+
+#### type OrderAddress
+
+```go
+type OrderAddress struct {
+	OrganizationName string       `json:"organizationName,omitempty"`
+	Title            string       `json:"title,omitempty"`
+	GivenName        string       `json:"givenName,omitempty"`
+	FamilyName       string       `json:"familyName,omitempty"`
+	Email            string       `json:"email,omitempty"`
+	Phone            *PhoneNumber `json:"phone,omitempty"`
+	StreetAndNumber  string       `json:"streetAndNumber,omitempty"`
+	StreetAdditional string       `json:"streetAdditional,omitempty"`
+	PostalCode       string       `json:"postalCode,omitempty"`
+	City             string       `json:"city,omitempty"`
+	Region           string       `json:"region,omitempty"`
+	Country          string       `json:"country,omitempty"`
+}
+```
+
+OrderAddress identify both the address and the person the order is billed or shipped to.
+
+#### type OrderLinks
+
+```go
+type OrderLinks struct {
+	Self          *URL `json:"self,omitempty"`
+	Checkout      *URL `json:"checkout,omitempty"`
+	Documentation *URL `json:"documentation,omitempty"`
+}
+```
+
+OrderLinks describes an object with several URL objects relevant to the order. Every URL object will contain an href and a type field.
+
+#### type OrderListLinks
+
+```go
+type OrderListLinks struct {
+	Self          *URL `json:"self,omitempty"`
+	Previous      *URL `json:"previous,omitempty"`
+	Next          *URL `json:"next,omitempty"`
+	Documentation *URL `json:"documentation,omitempty"`
+}
+```
+
+OrderListLinks describes an object with several URL objects relevant to the order. Every URL object will contain an href and a type field.
+
+#### type OrderLines
+
+```go
+type OrderLines struct {
+	Resource           string           `json:"resource,omitempty"`
+	ID                 string           `json:"id,omitempty"`
+	OrderID            string           `json:"orderId,omitempty"`
+	ProductType        *ProductType     `json:"type,omitempty"`
+	Name               string           `json:"name,omitempty"`
+	Amount             *Amount          `json:"amount,omitempty"`
+	Status             *OrderLineStatus `json:"status,omitempty"`
+	IsCancelable       bool             `json:"isCancelable,omitempty"`
+	Quantity           int              `json:"quantity,omitempty"`
+	QuantityShipped    int              `json:"quantityShipped,omitempty"`
+	AmountShipped      *Amount          `json:"amountShipped,omitempty"`
+	QuantityRefunded   int              `json:"quantityRefunded,omitempty"`
+	AmountRefunded     *Amount          `json:"amountRefunded,omitempty"`
+	QuantityCanceled   int              `json:"quantityCanceled,omitempty"`
+	AmountCanceled     *Amount          `json:"amountCanceled,omitempty"`
+	ShippableQuantity  int              `json:"shippableQuantity,omitempty"`
+	RefundableQuantity int              `json:"refundableQuantity,omitempty"`
+	CancelableQuantity int              `json:"cancelableQuantity,omitempty"`
+	UnitPrice          *Amount          `json:"unitPrice,omitempty"`
+	DiscountAmount     *Amount          `json:"discountAmount,omitempty"`
+	TotalAmount        *Amount          `json:"totalAmount,omitempty"`
+	VatRate            string           `json:"vatRate,omitempty"`
+	VatAmount          *Amount          `json:"vatAmount,omitempty"`
+	SKU                string           `json:"sku,omitempty"`
+	CreatedAt          *time.Time       `json:"createdAt,omitempty"`
+	Links              *OrderLineLinks  `json:"_links,omitempty"`
+	ImageURL           string           `json:"imageUrl,omitempty"`
+	ProductURL         string           `json:"productUrl,omitempty"`
+}
+```
+
+OrderLines contain the actual things the customer bought.
+
+#### type OrderList
+
+```go
+type OrderList struct {
+	Count    int `json:"count,omitempty"`
+	Embedded struct {
+		Orders []Orders `json:"orders,omitempty"`
+	} `json:"_embedded,omitempty"`
+	Links OrderListLinks `json:"links,omitempty"`
+}
+```
+
+OrderList for containing the response of list orders
+
+#### type OrderListRefund
+
+```go
+type OrderListRefund struct {
+	Count    int `json:"count,omitempty"`
+	Embedded struct {
+		Refunds []Refund `json:"refund,omitempty"`
+	} `json:"_embedded,omitempty"`
+	Links OrderListLinks `json:"links,omitempty"`
+}
+```
+
+OrderListRefund for containing the response of list orders.
+
+#### type ProductType
+
+```go
+type ProductType string
+```
+
+ProductType describes the type of product bought, for example, a physical or a digital product.
+
+#### const ProductType
+
+```go
+const (
+	Physical        ProductType = "physical"
+	Discount        ProductType = "discount"
+	Digital         ProductType = "digital"
+	ShippingFee     ProductType = "shipping_fee"
+	StoreCredit     ProductType = "store_credit"
+	GiftCardProduct ProductType = "gift_card"
+	Surcharge       ProductType = "surcharge"
+)
+```
+
+Valid product type.
+
+#### type OrderLineStatus
+
+```go
+type OrderLineStatus string
+```
+OrderLineStatus describes status of the order line.
+
+#### const OrderLineStatus
+
+```go
+const (
+	OrderLineCreated    OrderLineStatus = "created"
+	OrderLineAuthorized OrderLineStatus = "authorized"
+	OrderLinePaid       OrderLineStatus = "paid"
+	OrderLineShipping   OrderLineStatus = "shipping"
+	OrderLineCanceled   OrderLineStatus = "canceled"
+	OrderLineCompleted  OrderLineStatus = "completed"
+)
+```
+
+Valid order line status.
+
+#### type OrderLineLinks
+
+```go
+type OrderLineLinks struct {
+	ProductURL *URL `json:"productUrl,omitempty"`
+	ImageURL   *URL `json:"imageUrl,omitempty"`
+}
+```
+
+OrderLineLinks describes object with several URL objects relevant to the order line.
+
+#### type OrderOptions
+
+```go
+type OrderOptions struct {
+	Embed     []EmbedValue `url:"embed,omitempty"`
+	ProfileID string       `url:"profileId,omitempty"`
+}
+```
+
+OrderOptions describes order endpoint valid query string parameters. See: https://docs.mollie.com/reference/v2/orders-api/get-order.
+
+#### type OrderListOptions
+
+```go
+type OrderListOptions struct {
+	ProfileID string `url:"profileId,omitempty"`
+	From      string `url:"from,omitempty"`
+	Limit     int    `url:"limit,omitempty"`
+}
+```
+
+OrderListOptions describes order endpoint valid query string parameters. See: https://docs.mollie.com/reference/v2/orders-api/list-orders.
+
+#### type OrderListRefundOptions
+
+```go
+type OrderListRefundOptions struct {
+	From  string     `url:"from,omitempty"`
+	Limit int        `url:"limit,omitempty"`
+	Embed EmbedValue `url:"embed,omitempty"`
+}
+```
+
+OrderListRefundOptions describes order endpoint valid query string parameters. See: https://docs.mollie.com/reference/v2/orders-api/list-orders.
+
+#### type OrdersService
+
+```go
+type OrdersService service
+```
+
+OrdersService instance operates over refund resources.
+
+#### func (ors *OrdersService) Get
+
+```go
+func (ors *OrdersService) Get(orID string, opt *OrderOptions) (order Orders, err error)
+```
+
+Get retrieve a single order by its ID. See https://docs.mollie.com/reference/v2/orders-api/get-order
+
+#### func (ors *OrdersService) Create
+
+```go
+func (ors *OrdersService) Create(ord Orders, opt *OrderOptions) (order Orders, err error)
+```
+
+Create an order will automatically create the required payment to allow your customer to pay for the order. See https://docs.mollie.com/reference/v2/orders-api/create-order
+
+#### func (ors *OrdersService) Update
+
+```go
+func (ors *OrdersService) Update(orderID string, ord Orders) (order Orders, err error)
+```
+
+Update is used to update the billing and/or shipping address of an order. See https://docs.mollie.com/reference/v2/orders-api/update-order
+
+#### func (ors *OrdersService) Cancel
+
+```go
+func (ors *OrdersService) Cancel(orderID string) (order Orders, err error)
+```
+
+Cancel try to cancel the order that fulfill certain requirements. See https://docs.mollie.com/reference/v2/orders-api/cancel-order
+
+#### func (ors *OrdersService) List
+
+```go
+func (ors *OrdersService) List(opt *OrderListOptions) (ordList OrderList, err error)
+```
+
+List is to retrieve all orders. See https://docs.mollie.com/reference/v2/orders-api/list-orders
+
+#### func (ors *OrdersService) UpdateOrderline
+
+```go
+func (ors *OrdersService) UpdateOrderline(orderID string, orderlineID string, orderline OrderLines) (order Orders, err error)
+```
+
+UpdateOrderline can be used to update an order line. See https://docs.mollie.com/reference/v2/orders-api/update-orderline
+
+#### func (ors *OrdersService) CancelOrderLine
+
+```go
+func (ors *OrdersService) CancelOrderLine(orderID string, orderlines *Orders) (errorResponse *ErrorResponse, err error)
+```
+
+CancelOrderLine can be used to cancel one or more order lines that were previously authorized using a pay after delivery payment method. Use the Cancel Order API if you want to cancel the entire order or the remainder of the order. See https://docs.mollie.com/reference/v2/orders-api/cancel-order-lines
+
+#### func (ors *OrdersService) CreateOrderPayment
+
+```go
+func (ors *OrdersService) CreateOrderPayment(orderID string, ordPay *OrderPayment) (payment *Payment, errorResponse *ErrorResponse, err error)
+```
+
+CreateOrderPayment can only be created while the status of the order is created, and when the status of the existing payment is either expired, canceled or failed. See https://docs.mollie.com/reference/v2/orders-api/create-order-payment
+
+#### func (ors *OrdersService) CreateOrderRefund
+
+```go
+func (ors *OrdersService) CreateOrderRefund(orderID string, order *Orders) (refund Refund, errorResponse *ErrorResponse, err error)
+```
+
+CreateOrderRefund using the Orders API, refunds should be made against the order. See https://docs.mollie.com/reference/v2/orders-api/create-order-refund
+
+#### func (ors *OrdersService) ListOrderRefunds
+
+```go
+func (ors *OrdersService) ListOrderRefunds(orderID string, opt *OrderListRefundOptions) (orderListRefund OrderListRefund, err error)
+```
+
+ListOrderRefunds retrieve all order refunds. See https://docs.mollie.com/reference/v2/orders-api/list-order-refunds
+
+#### type ErrorResponse
+
+```go
+type ErrorResponse struct {
+	Status string      `json:"status,omitempty"`
+	Title  string      `json:"title,omitempty"`
+	Detail string      `json:"detail,omitempty"`
+	Field  string      `json:"field,omitempty"`
+	Extra  interface{} `json:"extra,omitempty"`
+	Links  struct {
+		Documentation URL `json:"documentation,omitempty"`
+	} `json:"_links,omitempty"`
+}
+```
+
+ErrorResponse describes the cancel endpoint response if there is an error
\ No newline at end of file
diff --git a/mollie/common_types.go b/mollie/common_types.go
index 67de268..7327f6c 100644
--- a/mollie/common_types.go
+++ b/mollie/common_types.go
@@ -133,3 +133,24 @@ const (
 	LiveMode Mode = "live"
 	TestMode Mode = "test"
 )
+
+// EmbedValue describes the valid value of embed query string.
+type EmbedValue string
+
+// Valid Embed query string value.
+const (
+	EmbedPayment EmbedValue = "payment"
+	EmbedRefund  EmbedValue = "refund"
+)
+
+// ErrorResponse describes the cancel endpoint response if there is an error
+type ErrorResponse struct {
+	Status string      `json:"status,omitempty"`
+	Title  string      `json:"title,omitempty"`
+	Detail string      `json:"detail,omitempty"`
+	Field  string      `json:"field,omitempty"`
+	Extra  interface{} `json:"extra,omitempty"`
+	Links  struct {
+		Documentation URL `json:"documentation,omitempty"`
+	} `json:"_links,omitempty"`
+}
diff --git a/mollie/mollie.go b/mollie/mollie.go
index 3f313f0..412282f 100644
--- a/mollie/mollie.go
+++ b/mollie/mollie.go
@@ -44,6 +44,7 @@ type Client struct {
 	Profiles      *ProfilesService
 	Refunds       *RefundsService
 	Shipments     *ShipmentsService
+	Orders        *OrdersService
 }
 
 type service struct {
@@ -120,7 +121,7 @@ func (c *Client) Do(req *http.Request) (*Response, error) {
 	response := newResponse(resp)
 	err = CheckResponse(resp)
 	if err != nil {
-		return nil, err
+		return response, err
 	}
 
 	return response, nil
@@ -160,6 +161,7 @@ func NewClient(baseClient *http.Client, c *Config) (mollie *Client, err error) {
 	mollie.Profiles = (*ProfilesService)(&mollie.common)
 	mollie.Refunds = (*RefundsService)(&mollie.common)
 	mollie.Shipments = (*ShipmentsService)(&mollie.common)
+	mollie.Orders = (*OrdersService)(&mollie.common)
 
 	// Parse authorization from environment
 	if tkn, ok := os.LookupEnv(APITokenEnv); ok {
diff --git a/mollie/orders.go b/mollie/orders.go
index ffda7c8..80ac722 100644
--- a/mollie/orders.go
+++ b/mollie/orders.go
@@ -1,10 +1,15 @@
 package mollie
 
 import (
+	"encoding/json"
+	"fmt"
+	"net/http"
 	"time"
+
+	"github.com/google/go-querystring/query"
 )
 
-// Orders explain the items that customers need to pay for
+// Orders explain the items that customers need to pay for.
 type Orders struct {
 	Resource            string         `json:"resource,omitempty"`
 	ID                  string         `json:"id,omitempty"`
@@ -17,13 +22,13 @@ type Orders struct {
 	Status              *OrderStatus   `json:"status,omitempty"`
 	IsCancelable        bool           `json:"isCancelable,omitempty"`
 	BillingAddress      *OrderAddress  `json:"billingAddress,omitempty"`
-	ConsumerDateOfBirth *time.Time     `json:"consumerDateOfBirth,omitempty"`
+	ConsumerDateOfBirth *ShortDate     `json:"consumerDateOfBirth,omitempty"`
 	OrderNumber         string         `json:"orderNumber,omitempty"`
 	ShippingAddress     *OrderAddress  `json:"shippingAddress,omitempty"`
 	Locale              *Locale        `json:"locale,omitempty"`
 	Metadata            interface{}    `json:"metadata,omitempty"`
 	RedirectURL         string         `json:"redirectUrl,omitempty"`
-	Lines               *OrderLines    `json:"lines,omitempty"`
+	Lines               []*OrderLines  `json:"lines,omitempty"`
 	WebhookURL          string         `json:"webhookUrl,omitempty"`
 	CreatedAt           *time.Time     `json:"createdAt,omitempty"`
 	ExpiresAt           *time.Time     `json:"expiresAt,omitempty"`
@@ -36,13 +41,30 @@ type Orders struct {
 		Payments []Payment `json:"payments,omitempty"`
 		Refunds  []Refund  `json:"refunds,omitempty"`
 	} `json:"_embedded,omitempty"`
-	Links *OrderLinks `json:"_links,omitempty"`
+	Links        *OrderLinks   `json:"_links,omitempty"`
+	OrderPayment *OrderPayment `json:"payment,omitempty"`
+	Description  string        `json:"description,omitempty"`
+}
+
+// OrderPayment describes payment specific parameters that can be passed during order creation
+type OrderPayment struct {
+	ConsumerAccount   string          `json:"consumerAccount,omitempty"`
+	CustomerID        string          `json:"customerId,omitempty"`
+	CustomerReference string          `json:"customerReference,omitempty"`
+	Issuer            string          `json:"issuer,omitempty"`
+	MandateID         string          `json:"mandateId,omitempty"`
+	SequenceType      *SequenceType   `json:"sequenceType,omitempty"`
+	VoucherNumber     string          `json:"voucherNumber,omitempty"`
+	VoucherPin        string          `json:"voucherPin,omitempty"`
+	WebhookURL        string          `json:"webhookUrl,omitempty"`
+	ApplicationFee    *ApplicationFee `json:"applicationFee,omitempty"`
+	Method            *PaymentMethod  `json:"method,omitempty"`
 }
 
-// OrderStatus describes the valid order status
+// OrderStatus describes the valid order status.
 type OrderStatus string
 
-// Valid order status
+// Valid order status.
 const (
 	Created    OrderStatus = "created"
 	Paid       OrderStatus = "paid"
@@ -61,7 +83,7 @@ type OrderAddress struct {
 	FamilyName       string       `json:"familyName,omitempty"`
 	Email            string       `json:"email,omitempty"`
 	Phone            *PhoneNumber `json:"phone,omitempty"`
-	StreetAndNumber  string       `json:"stringAndNumber,omitempty"`
+	StreetAndNumber  string       `json:"streetAndNumber,omitempty"`
 	StreetAdditional string       `json:"streetAdditional,omitempty"`
 	PostalCode       string       `json:"postalCode,omitempty"`
 	City             string       `json:"city,omitempty"`
@@ -78,6 +100,16 @@ type OrderLinks struct {
 	Documentation *URL `json:"documentation,omitempty"`
 }
 
+// OrderListLinks describes an object with several URL objects
+// relevant to the order.
+// Every URL object will contain an href and a type field.
+type OrderListLinks struct {
+	Self          *URL `json:"self,omitempty"`
+	Previous      *URL `json:"previous,omitempty"`
+	Next          *URL `json:"next,omitempty"`
+	Documentation *URL `json:"documentation,omitempty"`
+}
+
 // OrderLines contain the actual things the customer bought.
 type OrderLines struct {
 	Resource           string           `json:"resource,omitempty"`
@@ -85,6 +117,7 @@ type OrderLines struct {
 	OrderID            string           `json:"orderId,omitempty"`
 	ProductType        *ProductType     `json:"type,omitempty"`
 	Name               string           `json:"name,omitempty"`
+	Amount             *Amount          `json:"amount,omitempty"`
 	Status             *OrderLineStatus `json:"status,omitempty"`
 	IsCancelable       bool             `json:"isCancelable,omitempty"`
 	Quantity           int              `json:"quantity,omitempty"`
@@ -105,12 +138,32 @@ type OrderLines struct {
 	SKU                string           `json:"sku,omitempty"`
 	CreatedAt          *time.Time       `json:"createdAt,omitempty"`
 	Links              *OrderLineLinks  `json:"_links,omitempty"`
+	ImageURL           string           `json:"imageUrl,omitempty"`
+	ProductURL         string           `json:"productUrl,omitempty"`
+}
+
+// OrderList for containing the response of list orders
+type OrderList struct {
+	Count    int `json:"count,omitempty"`
+	Embedded struct {
+		Orders []Orders `json:"orders,omitempty"`
+	} `json:"_embedded,omitempty"`
+	Links OrderListLinks `json:"links,omitempty"`
+}
+
+// OrderListRefund for containing the response of list orders
+type OrderListRefund struct {
+	Count    int `json:"count,omitempty"`
+	Embedded struct {
+		Refunds []Refund `json:"refund,omitempty"`
+	} `json:"_embedded,omitempty"`
+	Links OrderListLinks `json:"links,omitempty"`
 }
 
 // ProductType describes the type of product bought, for example, a physical or a digital product.
 type ProductType string
 
-// Valid product type
+// Valid product type.
 const (
 	Physical        ProductType = "physical"
 	Discount        ProductType = "discount"
@@ -121,10 +174,10 @@ const (
 	Surcharge       ProductType = "surcharge"
 )
 
-// OrderLineStatus describes status of the order line
+// OrderLineStatus describes status of the order line.
 type OrderLineStatus string
 
-// Valid order line status
+// Valid order line status.
 const (
 	OrderLineCreated    OrderLineStatus = "created"
 	OrderLineAuthorized OrderLineStatus = "authorized"
@@ -134,8 +187,285 @@ const (
 	OrderLineCompleted  OrderLineStatus = "completed"
 )
 
-// OrderLineLinks describes object with several URL objects relevant to the order line
+// OrderLineLinks describes object with several URL objects relevant to the order line.
 type OrderLineLinks struct {
 	ProductURL *URL `json:"productUrl,omitempty"`
 	ImageURL   *URL `json:"imageUrl,omitempty"`
 }
+
+// OrderOptions describes order endpoint valid query string parameters.
+// See: https://docs.mollie.com/reference/v2/orders-api/get-order.
+type OrderOptions struct {
+	Embed     []EmbedValue `url:"embed,omitempty"`
+	ProfileID string       `url:"profileId,omitempty"`
+}
+
+// OrderListOptions describes order endpoint valid query string parameters.
+// See: https://docs.mollie.com/reference/v2/orders-api/list-orders.
+type OrderListOptions struct {
+	ProfileID string `url:"profileId,omitempty"`
+	From      string `url:"from,omitempty"`
+	Limit     int    `url:"limit,omitempty"`
+}
+
+// OrderListRefundOptions describes order endpoint valid query string parameters.
+// See: https://docs.mollie.com/reference/v2/orders-api/list-orders.
+type OrderListRefundOptions struct {
+	From  string     `url:"from,omitempty"`
+	Limit int        `url:"limit,omitempty"`
+	Embed EmbedValue `url:"embed,omitempty"`
+}
+
+// OrdersService instance operates over refund resources.
+type OrdersService service
+
+// Get retrieve a single order by its ID.
+// See https://docs.mollie.com/reference/v2/orders-api/get-order
+func (ors *OrdersService) Get(orID string, opt *OrderOptions) (order Orders, err error) {
+	u := fmt.Sprintf("v2/orders/%s", orID)
+	if opt != nil {
+		v, _ := query.Values(opt)
+		u = fmt.Sprintf("%s?%s", u, v.Encode())
+	}
+
+	req, err := ors.client.NewAPIRequest(http.MethodGet, u, nil)
+	if err != nil {
+		return
+	}
+
+	res, err := ors.client.Do(req)
+	if err != nil {
+		return
+	}
+
+	if err = json.Unmarshal(res.content, &order); err != nil {
+		return
+	}
+
+	return
+}
+
+// Create an order will automatically create the required payment to allow your customer to pay for the order.
+// See https://docs.mollie.com/reference/v2/orders-api/create-order
+func (ors *OrdersService) Create(ord Orders, opt *OrderOptions) (order Orders, err error) {
+	u := fmt.Sprintf("v2/orders")
+	if opt != nil {
+		v, _ := query.Values(opt)
+		u = fmt.Sprintf("%s?%s", u, v.Encode())
+	}
+
+	req, err := ors.client.NewAPIRequest(http.MethodPost, u, ord)
+	if err != nil {
+		return
+	}
+
+	res, err := ors.client.Do(req)
+	if err != nil {
+		return
+	}
+
+	if err = json.Unmarshal(res.content, &order); err != nil {
+		return
+	}
+
+	return
+}
+
+// Update is used to update the billing and/or shipping address of an order.
+// See https://docs.mollie.com/reference/v2/orders-api/update-order
+func (ors *OrdersService) Update(orderID string, ord Orders) (order Orders, err error) {
+	u := fmt.Sprintf("v2/orders/%s", orderID)
+
+	req, err := ors.client.NewAPIRequest(http.MethodPatch, u, ord)
+	if err != nil {
+		return
+	}
+
+	res, err := ors.client.Do(req)
+	if err != nil {
+		return
+	}
+
+	if err = json.Unmarshal(res.content, &order); err != nil {
+		return
+	}
+
+	return
+}
+
+// Cancel try to cancel the order that fulfill certain requirements
+// See https://docs.mollie.com/reference/v2/orders-api/cancel-order
+func (ors *OrdersService) Cancel(orderID string) (order Orders, err error) {
+	u := fmt.Sprintf("v2/orders/" + orderID)
+
+	req, err := ors.client.NewAPIRequest(http.MethodDelete, u, nil)
+	if err != nil {
+		return
+	}
+
+	res, err := ors.client.Do(req)
+	if err != nil {
+		return
+	}
+
+	if err = json.Unmarshal(res.content, &order); err != nil {
+		return
+	}
+
+	return
+}
+
+// List is to retrieve all orders.
+// See https://docs.mollie.com/reference/v2/orders-api/list-orders
+func (ors *OrdersService) List(opt *OrderListOptions) (ordList OrderList, err error) {
+	u := fmt.Sprintf("v2/orders")
+	if opt != nil {
+		v, _ := query.Values(opt)
+		u = fmt.Sprintf("%s?%s", u, v.Encode())
+	}
+
+	req, err := ors.client.NewAPIRequest(http.MethodGet, u, nil)
+	if err != nil {
+		return
+	}
+
+	res, err := ors.client.Do(req)
+	if err != nil {
+		return
+	}
+
+	if err = json.Unmarshal(res.content, &ordList); err != nil {
+		return
+	}
+
+	return
+}
+
+// UpdateOrderline can be used to update an order line.
+// See https://docs.mollie.com/reference/v2/orders-api/update-orderline
+func (ors *OrdersService) UpdateOrderline(orderID string, orderlineID string, orderline OrderLines) (order Orders, err error) {
+	u := fmt.Sprintf("v2/orders/%s/lines/%s", orderID, orderlineID)
+
+	req, err := ors.client.NewAPIRequest(http.MethodPatch, u, nil)
+	if err != nil {
+		return
+	}
+
+	res, err := ors.client.Do(req)
+	if err != nil {
+		return
+	}
+
+	if err = json.Unmarshal(res.content, &order); err != nil {
+		return
+	}
+
+	return
+}
+
+// CancelOrderLine can be used to cancel one or more order lines
+// that were previously authorized using a pay after delivery payment method.
+// Use the Cancel Order API if you want to cancel the entire order or the remainder of the order.
+// See https://docs.mollie.com/reference/v2/orders-api/cancel-order-lines
+func (ors *OrdersService) CancelOrderLine(orderID string, orderlines *Orders) (errorResponse *ErrorResponse, err error) {
+	u := fmt.Sprintf("v2/orders/%s/lines", orderID)
+
+	req, err := ors.client.NewAPIRequest(http.MethodDelete, u, orderlines)
+	if err != nil {
+		return
+	}
+
+	res, err := ors.client.Do(req)
+	if err != nil {
+		err = json.Unmarshal(res.content, &errorResponse)
+		if err != nil {
+			return
+		}
+		return
+	}
+
+	if res.StatusCode == http.StatusNoContent {
+		return nil, nil
+	}
+
+	return
+}
+
+// CreateOrderPayment can only be created while the status of the order is created,
+// and when the status of the existing payment is either expired, canceled or failed.
+// See https://docs.mollie.com/reference/v2/orders-api/create-order-payment
+func (ors *OrdersService) CreateOrderPayment(orderID string, ordPay *OrderPayment) (payment *Payment, errorResponse *ErrorResponse, err error) {
+	u := fmt.Sprintf("v2/orders/%s/payments", orderID)
+
+	req, err := ors.client.NewAPIRequest(http.MethodPost, u, ordPay)
+	if err != nil {
+		return
+	}
+
+	res, err := ors.client.Do(req)
+	if err != nil {
+		err = json.Unmarshal(res.content, &errorResponse)
+		if err != nil {
+			return
+		}
+		return
+	}
+
+	if err = json.Unmarshal(res.content, &payment); err != nil {
+		return
+	}
+
+	return
+}
+
+// CreateOrderRefund using the Orders API, refunds should be made against the order.
+// See https://docs.mollie.com/reference/v2/orders-api/create-order-refund
+func (ors *OrdersService) CreateOrderRefund(orderID string, order *Orders) (refund Refund, errorResponse *ErrorResponse, err error) {
+	u := fmt.Sprintf("v2/orders/%s/refunds", orderID)
+
+	req, err := ors.client.NewAPIRequest(http.MethodPost, u, order)
+	if err != nil {
+		return
+	}
+
+	res, err := ors.client.Do(req)
+	if err != nil {
+		err = json.Unmarshal(res.content, &errorResponse)
+		if err != nil {
+			return
+		}
+		return
+	}
+
+	if err = json.Unmarshal(res.content, &refund); err != nil {
+		return
+	}
+
+	return
+}
+
+// ListOrderRefunds retrieve all order refunds.
+// See https://docs.mollie.com/reference/v2/orders-api/list-order-refunds
+func (ors *OrdersService) ListOrderRefunds(orderID string, opt *OrderListRefundOptions) (orderListRefund OrderListRefund, err error) {
+	u := fmt.Sprintf("v2/orders/%s/refunds", orderID)
+	if opt != nil {
+		v, _ := query.Values(opt)
+		u = fmt.Sprintf("%s?%s", u, v.Encode())
+	}
+
+	req, err := ors.client.NewAPIRequest(http.MethodGet, u, nil)
+	if err != nil {
+		return
+	}
+
+	res, err := ors.client.Do(req)
+	if err != nil {
+		return
+	}
+
+	if err = json.Unmarshal(res.content, &orderListRefund); err != nil {
+		return
+	}
+
+	return
+}
diff --git a/mollie/refunds.go b/mollie/refunds.go
index 39ff8d9..6eda4cb 100644
--- a/mollie/refunds.go
+++ b/mollie/refunds.go
@@ -19,7 +19,7 @@ type Refund struct {
 	Description      string        `json:"description,omitempty"`
 	Metadata         interface{}   `json:"metadata,omitempty"`
 	Status           *RefundStatus `json:"status,omitempty"`
-	Lines            *OrderLines   `json:"lines,omitempty"`
+	Lines            []*OrderLines `json:"lines,omitempty"`
 	PaymentID        string        `json:"paymentId,omitempty"`
 	OrderID          string        `json:"orderId,omitempty"`
 	CreatedAt        *time.Time    `json:"createdAt,omitempty"`
@@ -50,10 +50,11 @@ const (
 // RefundLinks describes all the possible links to be returned with
 // a Refund object.
 type RefundLinks struct {
-	Self       *URL `json:"self,omitempty"`
-	Payment    *URL `json:"payment,omitempty"`
-	Settlement *URL `json:"settlement,omitempty"`
-	Order      *URL `json:"order,omitempty"`
+	Self          *URL `json:"self,omitempty"`
+	Payment       *URL `json:"payment,omitempty"`
+	Settlement    *URL `json:"settlement,omitempty"`
+	Order         *URL `json:"order,omitempty"`
+	Documentation *URL `json:"documentation,omitempty"`
 }
 
 // RefundOptions describes refund endpoint valid query string parameters.
@@ -63,14 +64,6 @@ type RefundOptions struct {
 	Embed EmbedValue `url:"embed,omitempty"`
 }
 
-// EmbedValue describes the valid value of embed query string.
-type EmbedValue string
-
-// Valid Embed query string value.
-const (
-	EmbedPayment EmbedValue = "payment"
-)
-
 // ListRefundOptions describes list refund endpoint valid query string parameters.
 //
 // See: https://docs.mollie.com/reference/v2/refunds-api/list-refunds.


Test patch:
diff --git a/mollie/orders_test.go b/mollie/orders_test.go
new file mode 100644
index 0000000..b9d5b3c
--- /dev/null
+++ b/mollie/orders_test.go
@@ -0,0 +1,440 @@
+package mollie
+
+import (
+	"encoding/json"
+	"net/http"
+	"testing"
+
+	"github.com/VictorAvelar/mollie-api-go/testdata"
+)
+
+func TestOrdersService_Get(t *testing.T) {
+	setup()
+	defer teardown()
+
+	ordID := "ord_kEn1PlbGa"
+
+	_ = tClient.WithAuthenticationValue("test_token")
+	tMux.HandleFunc("/v2/orders/"+ordID, func(w http.ResponseWriter, r *http.Request) {
+		testHeader(t, r, AuthHeader, "Bearer test_token")
+		testMethod(t, r, http.MethodGet)
+
+		if _, ok := r.Header[AuthHeader]; !ok {
+			w.WriteHeader(http.StatusUnauthorized)
+		}
+
+		w.WriteHeader(http.StatusOK)
+		_, _ = w.Write([]byte(testdata.GetOrderResponse))
+	})
+
+	opt := &OrderOptions{
+		Embed: []EmbedValue{
+			EmbedPayment,
+			EmbedRefund,
+		},
+	}
+
+	res, err := tClient.Orders.Get(ordID, opt)
+	if err != nil {
+		t.Fatal(err)
+	}
+
+	if res.ID != ordID {
+		t.Errorf("mismatching info. want %v got %v", ordID, res.ID)
+	}
+}
+
+func TestOrdersService_Create(t *testing.T) {
+	setup()
+	defer teardown()
+
+	_ = tClient.WithAuthenticationValue("test_token")
+	tMux.HandleFunc("/v2/orders", func(w http.ResponseWriter, r *http.Request) {
+		testHeader(t, r, AuthHeader, "Bearer test_token")
+		testMethod(t, r, http.MethodPost)
+
+		if _, ok := r.Header[AuthHeader]; !ok {
+			w.WriteHeader(http.StatusUnauthorized)
+		}
+
+		w.WriteHeader(http.StatusCreated)
+		_, _ = w.Write([]byte(testdata.CreateOrderResponse))
+	})
+
+	var order Orders
+	err := json.Unmarshal([]byte(testdata.CreateOrderRequest), &order)
+	if err != nil {
+		t.Error(err)
+	}
+
+	opt := &OrderOptions{
+		ProfileID: "pfl_3RkSN1zuPE",
+	}
+
+	res, err := tClient.Orders.Create(order, opt)
+	if err != nil {
+		t.Error(err)
+	}
+
+	if res.ID != "ord_pbjz8x" {
+		t.Errorf("mismatching info. want %v got %v", "ord_pbjz8x", res.ID)
+	}
+}
+
+func TestOrdersService_Update(t *testing.T) {
+	setup()
+	defer teardown()
+
+	orderID := "ord_kEn1PlbGa"
+
+	_ = tClient.WithAuthenticationValue("test_token")
+	tMux.HandleFunc("/v2/orders/"+orderID, func(w http.ResponseWriter, r *http.Request) {
+		testHeader(t, r, AuthHeader, "Bearer test_token")
+		testMethod(t, r, http.MethodPatch)
+
+		if _, ok := r.Header[AuthHeader]; !ok {
+			w.WriteHeader(http.StatusUnauthorized)
+		}
+
+		w.WriteHeader(http.StatusOK)
+		_, _ = w.Write([]byte(testdata.UpdateOrderResponse))
+	})
+
+	var order Orders
+	if err := json.Unmarshal([]byte(testdata.UpdateOrderRequest), &order); err != nil {
+		t.Error(err)
+	}
+
+	res, err := tClient.Orders.Update(orderID, order)
+	if err != nil {
+		t.Error(err)
+	}
+
+	if res.ID != orderID {
+		t.Errorf("mismatching info. want %v got %v", orderID, res.ID)
+	}
+}
+
+func TestOrdersService_Cancel(t *testing.T) {
+	setup()
+	defer teardown()
+
+	orderID := "ord_8wmqcHMN4U"
+
+	_ = tClient.WithAuthenticationValue("test_token")
+	tMux.HandleFunc("/v2/orders/"+orderID, func(w http.ResponseWriter, r *http.Request) {
+		testHeader(t, r, AuthHeader, "Bearer test_token")
+		testMethod(t, r, http.MethodDelete)
+
+		if _, ok := r.Header[AuthHeader]; !ok {
+			w.WriteHeader(http.StatusUnauthorized)
+		}
+
+		w.WriteHeader(http.StatusOK)
+		_, _ = w.Write([]byte(testdata.CancelOrderResponse))
+	})
+
+	res, err := tClient.Orders.Cancel(orderID)
+	if err != nil {
+		t.Error(err)
+	}
+
+	if res.ID != orderID {
+		t.Errorf("mismatching info. want %v got %v", orderID, res.ID)
+	}
+}
+
+func TestOrdersService_List(t *testing.T) {
+	setup()
+	defer teardown()
+
+	_ = tClient.WithAuthenticationValue("test_token")
+	tMux.HandleFunc("/v2/orders", func(w http.ResponseWriter, r *http.Request) {
+		testHeader(t, r, AuthHeader, "Bearer test_token")
+		testMethod(t, r, http.MethodGet)
+
+		if _, ok := r.Header[AuthHeader]; !ok {
+			w.WriteHeader(http.StatusUnauthorized)
+		}
+
+		w.WriteHeader(http.StatusOK)
+		_, _ = w.Write([]byte(testdata.OrderListResponse))
+	})
+
+	opt := &OrderListOptions{
+		ProfileID: "pfl_3RkSN1zuPE",
+	}
+
+	res, err := tClient.Orders.List(opt)
+	if err != nil {
+		t.Error(err)
+	}
+
+	if res.Count != 3 {
+		t.Errorf("mismatching info. want %v got %v", 3, res.Count)
+	}
+}
+
+func TestOrdersService_UpdateOrderline(t *testing.T) {
+	setup()
+	defer teardown()
+
+	orderID := "ord_pbjz8x"
+	orderlineID := "odl_dgtxyl"
+
+	_ = tClient.WithAuthenticationValue("test_token")
+	tMux.HandleFunc("/v2/orders/"+orderID+"/lines/"+orderlineID, func(w http.ResponseWriter, r *http.Request) {
+		testHeader(t, r, AuthHeader, "Bearer test_token")
+		testMethod(t, r, http.MethodPatch)
+
+		if _, ok := r.Header[AuthHeader]; !ok {
+			w.WriteHeader(http.StatusUnauthorized)
+		}
+
+		w.WriteHeader(http.StatusOK)
+		_, _ = w.Write([]byte(testdata.UpdateOrderlineResponse))
+	})
+
+	var orderline OrderLines
+	if err := json.Unmarshal([]byte(testdata.UpdateOrderlineRequest), &orderline); err != nil {
+		t.Error(err)
+	}
+
+	res, err := tClient.Orders.UpdateOrderline(orderID, orderlineID, orderline)
+	if err != nil {
+		t.Error(err)
+	}
+
+	if res.ID != orderID {
+		t.Errorf("mismatching info. want %v got %v", orderID, res.ID)
+	}
+}
+
+func TestOrdersService_CancelOrderLines(t *testing.T) {
+	setup()
+	defer teardown()
+
+	orderID := "ord_8wmqcHMN4U"
+
+	_ = tClient.WithAuthenticationValue("test_token")
+	tMux.HandleFunc("/v2/orders/"+orderID+"/lines", func(w http.ResponseWriter, r *http.Request) {
+		testHeader(t, r, AuthHeader, "Bearer test_token")
+		testMethod(t, r, http.MethodDelete)
+
+		if _, ok := r.Header[AuthHeader]; !ok {
+			w.WriteHeader(http.StatusUnauthorized)
+		}
+
+		decoder := json.NewDecoder(r.Body)
+
+		var ordLines Orders
+		err := decoder.Decode(&ordLines)
+		if err != nil {
+			w.WriteHeader(http.StatusBadRequest)
+		}
+
+		for _, el := range ordLines.Lines {
+			if (*el).ID == "odl_dgtwkn" {
+				w.WriteHeader(http.StatusUnprocessableEntity)
+				_, _ = w.Write([]byte(testdata.CancelOrderLinesResponseCancelReject))
+
+				break
+			}
+
+			if (*el).Amount == nil || (*el).Amount.Value == "0.00" || (*el).Amount.Currency == "" {
+				w.WriteHeader(http.StatusUnprocessableEntity)
+				_, _ = w.Write([]byte(testdata.CancelOrderLinesResponseAmountRequired))
+
+				break
+			}
+		}
+
+		w.WriteHeader(http.StatusNoContent)
+	})
+
+	var ordLines Orders
+	if err := json.Unmarshal([]byte(testdata.CancelOrderLinesRequest), &ordLines); err != nil {
+		t.Error(err)
+	}
+
+	res, err := tClient.Orders.CancelOrderLine(orderID, &ordLines)
+	if err == nil {
+		t.Fail()
+	}
+	t.Log(res)
+
+	if err := json.Unmarshal([]byte(testdata.CancelOrderLinesRejectRequest), &ordLines); err != nil {
+		t.Error(err)
+	}
+
+	res, err = tClient.Orders.CancelOrderLine(orderID, &ordLines)
+	if err == nil {
+		t.Fail()
+	}
+	t.Log(res)
+}
+
+func TestOrdersService_CreatePayment(t *testing.T) {
+	setup()
+	defer teardown()
+
+	orderID := "ord_8wmqcHMN4U"
+
+	_ = tClient.WithAuthenticationValue("test_token")
+	tMux.HandleFunc("/v2/orders/"+orderID+"/payments", func(w http.ResponseWriter, r *http.Request) {
+		testHeader(t, r, AuthHeader, "Bearer test_token")
+		testMethod(t, r, http.MethodPost)
+
+		if _, ok := r.Header[AuthHeader]; !ok {
+			w.WriteHeader(http.StatusUnauthorized)
+		}
+
+		w.WriteHeader(http.StatusCreated)
+		_, _ = w.Write([]byte(testdata.CreateOrderPaymentResponse))
+	})
+
+	var ordPay OrderPayment
+	if err := json.Unmarshal([]byte(testdata.CreateOrderPaymentRequest), &ordPay); err != nil {
+		t.Error(err)
+	}
+
+	res, errResp, err := tClient.Orders.CreateOrderPayment(orderID, &ordPay)
+	if err != nil {
+		t.Error(errResp)
+	}
+
+	if res.ID != "tr_WDqYK6vllg" {
+		t.Errorf("mismatching info. want %v got %v", "tr_WDqYK6vllg", res.ID)
+	}
+}
+
+func TestOrdersService_CreatePaymentFailed(t *testing.T) {
+	setup()
+	defer teardown()
+
+	orderID := "ord_stTC2WHAuS"
+
+	_ = tClient.WithAuthenticationValue("test_token")
+	tMux.HandleFunc("/v2/orders/"+orderID+"/payments", func(w http.ResponseWriter, r *http.Request) {
+		testHeader(t, r, AuthHeader, "Bearer test_token")
+		testMethod(t, r, http.MethodPost)
+
+		if _, ok := r.Header[AuthHeader]; !ok {
+			w.WriteHeader(http.StatusUnauthorized)
+		}
+
+		w.WriteHeader(http.StatusUnprocessableEntity)
+		_, _ = w.Write([]byte(testdata.CreateOrderPaymentResponseFailed))
+	})
+
+	var ordPay OrderPayment
+	if err := json.Unmarshal([]byte(testdata.CreateOrderPaymentRequest), &ordPay); err != nil {
+		t.Error(err)
+	}
+
+	_, errResp, err := tClient.Orders.CreateOrderPayment(orderID, &ordPay)
+	if err == nil {
+		t.Fail()
+	}
+
+	t.Log(errResp)
+}
+
+func TestOrdersService_CreateOrderRefund(t *testing.T) {
+	setup()
+	defer teardown()
+
+	orderID := "ord_stTC2WHAuS"
+
+	_ = tClient.WithAuthenticationValue("test_token")
+	tMux.HandleFunc("/v2/orders/"+orderID+"/refunds", func(w http.ResponseWriter, r *http.Request) {
+		testHeader(t, r, AuthHeader, "Bearer test_token")
+		testMethod(t, r, http.MethodPost)
+
+		if _, ok := r.Header[AuthHeader]; !ok {
+			w.WriteHeader(http.StatusUnauthorized)
+		}
+
+		w.WriteHeader(http.StatusCreated)
+		_, _ = w.Write([]byte(testdata.CreateOrderRefundResponse))
+	})
+
+	var order Orders
+	if err := json.Unmarshal([]byte(testdata.CreateOrderRefundRequest), &order); err != nil {
+		t.Error(err)
+	}
+
+	res, _, err := tClient.Orders.CreateOrderRefund(orderID, &order)
+	if err != nil {
+		t.Error(err)
+	}
+
+	if res.ID != "re_4qqhO89gsT" {
+		t.Errorf("mismatching info. want %v got %v", "re_4qqhO89gsT", res.ID)
+	}
+}
+
+func TestOrdersService_CreateOrderRefundFailed(t *testing.T) {
+	setup()
+	defer teardown()
+
+	orderID := "ord_stTC2WHAuS"
+
+	_ = tClient.WithAuthenticationValue("test_token")
+	tMux.HandleFunc("/v2/orders/"+orderID+"/refunds", func(w http.ResponseWriter, r *http.Request) {
+		testHeader(t, r, AuthHeader, "Bearer test_token")
+		testMethod(t, r, http.MethodPost)
+
+		if _, ok := r.Header[AuthHeader]; !ok {
+			w.WriteHeader(http.StatusUnauthorized)
+		}
+
+		w.WriteHeader(http.StatusUnprocessableEntity)
+		_, _ = w.Write([]byte(testdata.CreateOrderRefundResponseFailed))
+	})
+
+	var order Orders
+	if err := json.Unmarshal([]byte(testdata.CreateOrderRefundRequest), &order); err != nil {
+		t.Error(err)
+	}
+
+	_, errResp, err := tClient.Orders.CreateOrderRefund(orderID, &order)
+	if err == nil {
+		t.Fail()
+	}
+
+	t.Log(errResp)
+}
+
+func TestOrdersService_ListOrderRefund(t *testing.T) {
+	setup()
+	defer teardown()
+
+	orderID := "ord_pbjz8x"
+
+	_ = tClient.WithAuthenticationValue("test_token")
+	tMux.HandleFunc("/v2/orders/"+orderID+"/refunds", func(w http.ResponseWriter, r *http.Request) {
+		testHeader(t, r, AuthHeader, "Bearer test_token")
+		testMethod(t, r, http.MethodGet)
+
+		if _, ok := r.Header[AuthHeader]; !ok {
+			w.WriteHeader(http.StatusUnauthorized)
+		}
+
+		w.WriteHeader(http.StatusOK)
+		_, _ = w.Write([]byte(testdata.ListOrderRefundResponse))
+	})
+
+	opt := &OrderListRefundOptions{
+		Embed: EmbedPayment,
+	}
+
+	res, err := tClient.Orders.ListOrderRefunds(orderID, opt)
+	if err != nil {
+		t.Error(err)
+	}
+
+	if res.Count != 1 {
+		t.Errorf("mismatching info. want %v got %v", 1, res.Count)
+	}
+}
diff --git a/testdata/orders.go b/testdata/orders.go
new file mode 100644
index 0000000..fcdb8bd
--- /dev/null
+++ b/testdata/orders.go
@@ -0,0 +1,1487 @@
+package testdata
+
+// GetOrderResponse example
+const GetOrderResponse = `{
+	"resource": "order",
+	"id": "ord_kEn1PlbGa",
+	"profileId": "pfl_URR55HPMGx",
+	"method": "ideal",
+	"amount": {
+		"value": "1027.99",
+		"currency": "EUR"
+	},
+	"status": "created",
+	"isCancelable": true,
+	"metadata": null,
+	"createdAt": "2018-08-02T09:29:56+00:00",
+	"expiresAt": "2018-08-30T09:29:56+00:00",
+	"mode": "live",
+	"locale": "nl_NL",
+	"billingAddress": {
+		"organizationName": "Mollie B.V.",
+		"streetAndNumber": "Keizersgracht 313",
+		"postalCode": "1016 EE",
+		"city": "Amsterdam",
+		"country": "nl",
+		"givenName": "Luke",
+		"familyName": "Skywalker",
+		"email": "luke@skywalker.com"
+	},
+	"orderNumber": "18475",
+	"shippingAddress": {
+		"organizationName": "Mollie B.V.",
+		"streetAndNumber": "Keizersgracht 313",
+		"postalCode": "1016 EE",
+		"city": "Amsterdam",
+		"country": "nl",
+		"givenName": "Luke",
+		"familyName": "Skywalker",
+		"email": "luke@skywalker.com"
+	},
+	"redirectUrl": "https://example.org/redirect",
+	"lines": [
+		{
+			"resource": "orderline",
+			"id": "odl_dgtxyl",
+			"orderId": "ord_pbjz8x",
+			"name": "LEGO 42083 Bugatti Chiron",
+			"sku": "5702016116977",
+			"type": "physical",
+			"status": "created",
+			"metadata": null,
+			"isCancelable": false,
+			"quantity": 2,
+			"quantityShipped": 0,
+			"amountShipped": {
+				"value": "0.00",
+				"currency": "EUR"
+			},
+			"quantityRefunded": 0,
+			"amountRefunded": {
+				"value": "0.00",
+				"currency": "EUR"
+			},
+			"quantityCanceled": 0,
+			"amountCanceled": {
+				"value": "0.00",
+				"currency": "EUR"
+			},
+			"shippableQuantity": 0,
+			"refundableQuantity": 0,
+			"cancelableQuantity": 0,
+			"unitPrice": {
+				"value": "399.00",
+				"currency": "EUR"
+			},
+			"vatRate": "21.00",
+			"vatAmount": {
+				"value": "121.14",
+				"currency": "EUR"
+			},
+			"discountAmount": {
+				"value": "100.00",
+				"currency": "EUR"
+			},
+			"totalAmount": {
+				"value": "698.00",
+				"currency": "EUR"
+			},
+			"createdAt": "2018-08-02T09:29:56+00:00",
+			"_links": {
+				"productUrl": {
+					"href": "https://shop.lego.com/nl-NL/Bugatti-Chiron-42083",
+					"type": "text/html"
+				},
+				"imageUrl": {
+					"href": "https://sh-s7-live-s.legocdn.com/is/image//LEGO/42083_alt1?$main$",
+					"type": "text/html"
+				}
+			}
+		},
+		{
+			"resource": "orderline",
+			"id": "odl_jp31jz",
+			"orderId": "ord_pbjz8x",
+			"name": "LEGO 42056 Porsche 911 GT3 RS",
+			"sku": "5702015594028",
+			"type": "physical",
+			"status": "created",
+			"metadata": null,
+			"isCancelable": false,
+			"quantity": 1,
+			"quantityShipped": 0,
+			"amountShipped": {
+				"value": "0.00",
+				"currency": "EUR"
+			},
+			"quantityRefunded": 0,
+			"amountRefunded": {
+				"value": "0.00",
+				"currency": "EUR"
+			},
+			"quantityCanceled": 0,
+			"amountCanceled": {
+				"value": "0.00",
+				"currency": "EUR"
+			},
+			"shippableQuantity": 0,
+			"refundableQuantity": 0,
+			"cancelableQuantity": 0,
+			"unitPrice": {
+				"value": "329.99",
+				"currency": "EUR"
+			},
+			"vatRate": "21.00",
+			"vatAmount": {
+				"value": "57.27",
+				"currency": "EUR"
+			},
+			"totalAmount": {
+				"value": "329.99",
+				"currency": "EUR"
+			},
+			"createdAt": "2018-08-02T09:29:56+00:00",
+			"_links": {
+				"productUrl": {
+					"href": "https://shop.lego.com/nl-NL/Porsche-911-GT3-RS-42056",
+					"type": "text/html"
+				},
+				"imageUrl": {
+					"href": "https://sh-s7-live-s.legocdn.com/is/image/LEGO/42056?$PDPDefault$",
+					"type": "text/html"
+				}
+			}
+		}
+	],
+	"_embedded": {
+		"payments": [
+			{
+				"resource": "payment",
+				"id": "tr_ncaPcAhuUV",
+				"mode": "live",
+				"createdAt": "2018-09-07T12:00:05+00:00",
+				"amount": {
+					"value": "1027.99",
+					"currency": "EUR"
+				},
+				"description": "Order #1337 (Lego cars)",
+				"method": null,
+				"metadata": null,
+				"status": "open",
+				"isCancelable": false,
+				"locale": "nl_NL",
+				"profileId": "pfl_URR55HPMGx",
+				"orderId": "ord_kEn1PlbGa",
+				"sequenceType": "oneoff",
+				"redirectUrl": "https://example.org/redirect",
+				"_links": {
+					"self": {
+						"href": "https://api.mollie.com/v2/payments/tr_ncaPcAhuUV",
+						"type": "application/hal+json"
+					},
+					"checkout": {
+						"href": "https://www.mollie.com/payscreen/select-method/ncaPcAhuUV",
+						"type": "text/html"
+					},
+					"order": {
+						"href": "https://api.mollie.com/v2/orders/ord_kEn1PlbGa",
+						"type": "application/hal+json"
+					}
+				}
+			}
+		],
+		"refunds": [
+			{
+				"resource": "refund",
+				"id": "re_vD3Jm32wQt",
+				"amount": {
+					"value": "329.99",
+					"currency": "EUR"
+				},
+				"status": "pending",
+				"createdAt": "2019-01-15T15:41:21+00:00",
+				"description": "Required quantity not in stock, refunding one photo book.",
+				"orderId": "ord_kEn1PlbGa",
+				"paymentId": "tr_mjvPwykz3x",
+				"settlementAmount": {
+					"value": "-329.99",
+					"currency": "EUR"
+				},
+				"lines": [
+					{
+						"resource": "orderline",
+						"id": "odl_dgtxyl",
+						"orderId": "ord_kEn1PlbGa",
+						"name": "LEGO 42056 Porsche 911 GT3 RS",
+						"sku": "5702015594028",
+						"type": "physical",
+						"status": "completed",
+						"isCancelable": false,
+						"quantity": 1,
+						"unitPrice": {
+							"value": "329.99",
+							"currency": "EUR"
+						},
+						"vatRate": "21.00",
+						"vatAmount": {
+							"value": "57.27",
+							"currency": "EUR"
+						},
+						"totalAmount": {
+							"value": "329.99",
+							"currency": "EUR"
+						},
+						"createdAt": "2019-01-15T15:22:45+00:00",
+						"_links": {
+							"productUrl": {
+								"href": "https://shop.lego.com/nl-NL/Porsche-911-GT3-RS-42056",
+								"type": "text/html"
+							},
+							"imageUrl": {
+								"href": "https://sh-s7-live-s.legocdn.com/is/image/LEGO/42056?$PDPDefault$",
+								"type": "text/html"
+							}
+						}
+					}
+				],
+				"_links": {
+					"self": {
+						"href": "https://api.mollie.com/v2/payments/tr_mjvPwykz3x/refunds/re_vD3Jm32wQt",
+						"type": "application/hal+json"
+					},
+					"payment": {
+						"href": "https://api.mollie.com/v2/payments/tr_mjvPwykz3x",
+						"type": "application/hal+json"
+					},
+					"order": {
+						"href": "https://api.mollie.com/v2/orders/ord_kEn1PlbGa",
+						"type": "application/hal+json"
+					}
+				}
+			}
+		]
+	},
+	"_links": {
+		"self": {
+			"href": "https://api.mollie.com/v2/orders/ord_pbjz8x",
+			"type": "application/hal+json"
+		},
+		"checkout": {
+			"href": "https://www.mollie.com/payscreen/order/checkout/pbjz8x",
+			"type": "text/html"
+		},
+		"documentation": {
+			"href": "https://docs.mollie.com/reference/v2/orders-api/get-order",
+			"type": "text/html"
+		}
+	}
+}`
+
+// CreateOrderRequest example of create order request
+const CreateOrderRequest = `{
+	"amount": {
+	   "value": "1027.99",
+	   "currency": "EUR"
+	},
+	"billingAddress": {
+	   "organizationName": "Mollie B.V.",
+	   "streetAndNumber": "Keizersgracht 313",
+	   "city": "Amsterdam",
+	   "region": "Noord-Holland",
+	   "postalCode": "1234AB",
+	   "country": "NL",
+	   "title": "Dhr",
+	   "givenName": "Piet",
+	   "familyName": "Mondriaan",
+	   "email": "piet@mondriaan.com",
+	   "phone": "+31208202070"
+	},
+	"shippingAddress": {
+	   "organizationName": "Mollie B.V.",
+	   "streetAndNumber": "Prinsengracht 313",
+	   "streetAdditional": "4th floor",
+	   "city": "Haarlem",
+	   "region": "Noord-Holland",
+	   "postalCode": "5678AB",
+	   "country": "NL",
+	   "title": "Mr",
+	   "givenName": "Chuck",
+	   "familyName": "Norris",
+	   "email": "norris@chucknorrisfacts.net"
+	},
+	"metadata": {
+	   "order_id": "1337",
+	   "description": "Lego cars"
+	},
+	"consumerDateOfBirth": "1958-01-31",
+	"locale": "nl_NL",
+	"orderNumber": "1337",
+	"redirectUrl": "https://example.org/redirect",
+	"webhookUrl": "https://example.org/webhook",
+	"method": "klarnapaylater",
+	"lines": [
+	   {
+			 "type": "physical",
+			 "sku": "5702016116977",
+			 "name": "LEGO 42083 Bugatti Chiron",
+			 "productUrl": "https://shop.lego.com/nl-NL/Bugatti-Chiron-42083",
+			 "imageUrl": "https://sh-s7-live-s.legocdn.com/is/image//LEGO/42083_alt1?$main$",
+			 "metadata": {
+				"order_id": "1337",
+				"description": "Bugatti Chiron"
+			 },
+			 "quantity": 2,
+			 "vatRate": "21.00",
+			 "unitPrice": {
+				"currency": "EUR",
+				"value": "399.00"
+			 },
+			 "totalAmount": {
+				"currency": "EUR",
+				"value": "698.00"
+			 },
+			 "discountAmount": {
+				"currency": "EUR",
+				"value": "100.00"
+			 },
+			 "vatAmount": {
+				"currency": "EUR",
+				"value": "121.14"
+			 }
+	   },
+	   {
+			 "type": "physical",
+			 "sku": "5702015594028",
+			 "name": "LEGO 42056 Porsche 911 GT3 RS",
+			 "productUrl": "https://shop.lego.com/nl-NL/Porsche-911-GT3-RS-42056",
+			 "imageUrl": "https://sh-s7-live-s.legocdn.com/is/image/LEGO/42056?$PDPDefault$",
+			 "quantity": 1,
+			 "vatRate": "21.00",
+			 "unitPrice": {
+				"currency": "EUR",
+				"value": "329.99"
+			 },
+			 "totalAmount": {
+				"currency": "EUR",
+				"value": "329.99"
+			 },
+			 "vatAmount": {
+				"currency": "EUR",
+				"value": "57.27"
+			 }
+	   }
+	]
+ }`
+
+// CreateOrderResponse example response of create order
+const CreateOrderResponse = `{
+    "resource": "order",
+    "id": "ord_pbjz8x",
+    "profileId": "pfl_URR55HPMGx",
+    "method": "klarnapaylater",
+    "amount": {
+        "value": "1027.99",
+        "currency": "EUR"
+    },
+    "status": "created",
+    "isCancelable": true,
+    "metadata": {
+        "order_id": "1337",
+        "description": "Lego cars"
+    },
+    "createdAt": "2018-08-02T09:29:56+00:00",
+    "expiresAt": "2018-08-30T09:29:56+00:00",
+    "mode": "test",
+    "locale": "nl_NL",
+    "billingAddress": {
+        "organizationName": "Mollie B.V.",
+        "streetAndNumber": "Keizersgracht 313",
+        "city": "Amsterdam",
+        "region": "Noord-Holland",
+        "postalCode": "1234AB",
+        "country": "NL",
+        "title": "Dhr.",
+        "givenName": "Piet",
+        "familyName": "Mondriaan",
+        "email": "piet@mondriaan.com",
+        "phone": "+31309202070"
+    },
+    "consumerDateOfBirth": "1958-01-31",
+    "orderNumber": "1337",
+    "shippingAddress": {
+        "organizationName": "Mollie B.V.",
+        "streetAndNumber": "Keizersgracht 313",
+        "streetAdditional": "4th floor",
+        "city": "Haarlem",
+        "region": "Noord-Holland",
+        "postalCode": "5678AB",
+        "country": "NL",
+        "title": "Mr.",
+        "givenName": "Chuck",
+        "familyName": "Norris",
+        "email": "norris@chucknorrisfacts.net"
+    },
+    "redirectUrl": "https://example.org/redirect",
+    "webhookUrl": "https://example.org/webhook",
+    "lines": [
+        {
+            "resource": "orderline",
+            "id": "odl_dgtxyl",
+            "orderId": "ord_pbjz8x",
+            "name": "LEGO 42083 Bugatti Chiron",
+            "sku": "5702016116977",
+            "type": "physical",
+            "status": "created",
+            "metadata": {
+               "order_id": "1337",
+               "description": "Bugatti Chiron"
+            },
+            "isCancelable": false,
+            "quantity": 2,
+            "quantityShipped": 0,
+            "amountShipped": {
+                "value": "0.00",
+                "currency": "EUR"
+            },
+            "quantityRefunded": 0,
+            "amountRefunded": {
+                "value": "0.00",
+                "currency": "EUR"
+            },
+            "quantityCanceled": 0,
+            "amountCanceled": {
+                "value": "0.00",
+                "currency": "EUR"
+            },
+            "shippableQuantity": 0,
+            "refundableQuantity": 0,
+            "cancelableQuantity": 0,
+            "unitPrice": {
+                "value": "399.00",
+                "currency": "EUR"
+            },
+            "vatRate": "21.00",
+            "vatAmount": {
+                "value": "121.14",
+                "currency": "EUR"
+            },
+            "discountAmount": {
+                "value": "100.00",
+                "currency": "EUR"
+            },
+            "totalAmount": {
+                "value": "698.00",
+                "currency": "EUR"
+            },
+            "createdAt": "2018-08-02T09:29:56+00:00",
+            "_links": {
+                "productUrl": {
+                    "href": "https://shop.lego.com/nl-NL/Bugatti-Chiron-42083",
+                    "type": "text/html"
+                },
+                "imageUrl": {
+                    "href": "https://sh-s7-live-s.legocdn.com/is/image//LEGO/42083_alt1?$main$",
+                    "type": "text/html"
+                }
+            }
+        },
+        {
+            "resource": "orderline",
+            "id": "odl_jp31jz",
+            "orderId": "ord_pbjz8x",
+            "name": "LEGO 42056 Porsche 911 GT3 RS",
+            "sku": "5702015594028",
+            "type": "physical",
+            "status": "created",
+            "metadata": null,
+            "isCancelable": false,
+            "quantity": 1,
+            "quantityShipped": 0,
+            "amountShipped": {
+                "value": "0.00",
+                "currency": "EUR"
+            },
+            "quantityRefunded": 0,
+            "amountRefunded": {
+                "value": "0.00",
+                "currency": "EUR"
+            },
+            "quantityCanceled": 0,
+            "amountCanceled": {
+                "value": "0.00",
+                "currency": "EUR"
+            },
+            "shippableQuantity": 0,
+            "refundableQuantity": 0,
+            "cancelableQuantity": 0,
+            "unitPrice": {
+                "value": "329.99",
+                "currency": "EUR"
+            },
+            "vatRate": "21.00",
+            "vatAmount": {
+                "value": "57.27",
+                "currency": "EUR"
+            },
+            "totalAmount": {
+                "value": "329.99",
+                "currency": "EUR"
+            },
+            "createdAt": "2018-08-02T09:29:56+00:00",
+            "_links": {
+                "productUrl": {
+                    "href": "https://shop.lego.com/nl-NL/Porsche-911-GT3-RS-42056",
+                    "type": "text/html"
+                },
+                "imageUrl": {
+                    "href": "https://sh-s7-live-s.legocdn.com/is/image/LEGO/42056?$PDPDefault$",
+                    "type": "text/html"
+                }
+            }
+        }
+    ],
+    "_links": {
+        "self": {
+            "href": "https://api.mollie.com/v2/orders/ord_pbjz8x",
+            "type": "application/hal+json"
+        },
+        "checkout": {
+            "href": "https://www.mollie.com/payscreen/order/checkout/pbjz8x",
+            "type": "text/html"
+        },
+        "documentation": {
+            "href": "https://docs.mollie.com/reference/v2/orders-api/get-order",
+            "type": "text/html"
+        }
+    }
+}`
+
+// UpdateOrderRequest is a request example of updating an order
+const UpdateOrderRequest = `{
+	"billingAddress": {
+	   "organizationName": "Mollie B.V.",
+	   "streetAndNumber": "Keizersgracht 313",
+	   "city": "Amsterdam",
+	   "region": "Noord-Holland",
+	   "postalCode": "1234AB",
+	   "country": "NL",
+	   "title": "Dhr",
+	   "givenName": "Piet",
+	   "familyName": "Mondriaan",
+	   "email": "piet@mondriaan.com",
+	   "phone": "+31208202070"
+	}
+}`
+
+// UpdateOrderResponse is a response example of updating an order
+const UpdateOrderResponse = `{
+	"resource": "order",
+	"id": "ord_kEn1PlbGa",
+	"profileId": "pfl_URR55HPMGx",
+	"method": "ideal",
+	"amount": {
+		"value": "1027.99",
+		"currency": "EUR"
+	},
+	"status": "created",
+	"isCancelable": true,
+	"metadata": null,
+	"createdAt": "2018-08-02T09:29:56+00:00",
+	"expiresAt": "2018-08-30T09:29:56+00:00",
+	"mode": "live",
+	"locale": "nl_NL",
+	"billingAddress": {
+		"organizationName": "Mollie B.V.",
+		"streetAndNumber": "Keizersgracht 313",
+		"city": "Amsterdam",
+		"region": "Noord-Holland",
+		"postalCode": "1234AB",
+		"country": "NL",
+		"title": "Dhr",
+		"givenName": "Piet",
+		"familyName": "Mondriaan",
+		"email": "piet@mondriaan.com",
+		"phone": "+31208202070"
+	},
+	"orderNumber": "18475",
+	"shippingAddress": {
+		"organizationName": "Mollie B.V.",
+		"streetAndNumber": "Keizersgracht 313",
+		"postalCode": "1016 EE",
+		"city": "Amsterdam",
+		"country": "nl",
+		"givenName": "Luke",
+		"familyName": "Skywalker",
+		"email": "luke@skywalker.com"
+	},
+   "redirectUrl": "https://example.org/redirect",
+	"lines": [
+		{
+			"resource": "orderline",
+			"id": "odl_dgtxyl",
+			"orderId": "ord_pbjz8x",
+			"name": "LEGO 42083 Bugatti Chiron",
+			"sku": "5702016116977",
+			"type": "physical",
+			"status": "created",
+			"metadata": null,
+			"isCancelable": false,
+			"quantity": 2,
+			"quantityShipped": 0,
+			"amountShipped": {
+				"value": "0.00",
+				"currency": "EUR"
+			},
+			"quantityRefunded": 0,
+			"amountRefunded": {
+				"value": "0.00",
+				"currency": "EUR"
+			},
+			"quantityCanceled": 0,
+			"amountCanceled": {
+				"value": "0.00",
+				"currency": "EUR"
+			},
+		   "shippableQuantity": 0,
+		   "refundableQuantity": 0,
+		   "cancelableQuantity": 0,
+			"unitPrice": {
+				"value": "399.00",
+				"currency": "EUR"
+			},
+			"vatRate": "21.00",
+			"vatAmount": {
+				"value": "121.14",
+				"currency": "EUR"
+			},
+			"discountAmount": {
+				"value": "100.00",
+				"currency": "EUR"
+			},
+			"totalAmount": {
+				"value": "698.00",
+				"currency": "EUR"
+			},
+			"createdAt": "2018-08-02T09:29:56+00:00",
+			"_links": {
+				"productUrl": {
+					"href": "https://shop.lego.com/nl-NL/Bugatti-Chiron-42083",
+					"type": "text/html"
+				},
+				"imageUrl": {
+					"href": "https://sh-s7-live-s.legocdn.com/is/image//LEGO/42083_alt1?$main$",
+					"type": "text/html"
+				}
+			}
+		},
+		{
+			"resource": "orderline",
+			"id": "odl_jp31jz",
+			"orderId": "ord_pbjz8x",
+			"name": "LEGO 42056 Porsche 911 GT3 RS",
+			"sku": "5702015594028",
+			"type": "physical",
+			"status": "created",
+			"metadata": null,
+			"isCancelable": false,
+			"quantity": 1,
+			"quantityShipped": 0,
+			"amountShipped": {
+				"value": "0.00",
+				"currency": "EUR"
+			},
+			"quantityRefunded": 0,
+			"amountRefunded": {
+				"value": "0.00",
+				"currency": "EUR"
+			},
+			"quantityCanceled": 0,
+			"amountCanceled": {
+				"value": "0.00",
+				"currency": "EUR"
+			},
+		   "shippableQuantity": 0,
+		   "refundableQuantity": 0,
+		   "cancelableQuantity": 0,
+			"unitPrice": {
+				"value": "329.99",
+				"currency": "EUR"
+			},
+			"vatRate": "21.00",
+			"vatAmount": {
+				"value": "57.27",
+				"currency": "EUR"
+			},
+			"totalAmount": {
+				"value": "329.99",
+				"currency": "EUR"
+			},
+			"createdAt": "2018-08-02T09:29:56+00:00",
+			"_links": {
+				"productUrl": {
+					"href": "https://shop.lego.com/nl-NL/Porsche-911-GT3-RS-42056",
+					"type": "text/html"
+				},
+				"imageUrl": {
+					"href": "https://sh-s7-live-s.legocdn.com/is/image/LEGO/42056?$PDPDefault$",
+					"type": "text/html"
+				}
+			}
+		}
+	],
+	"_links": {
+		"self": {
+			"href": "https://api.mollie.com/v2/orders/ord_pbjz8x",
+			"type": "application/hal+json"
+		},
+		"checkout": {
+			"href": "https://www.mollie.com/payscreen/order/checkout/pbjz8x",
+			"type": "text/html"
+		},
+		"documentation": {
+			"href": "https://docs.mollie.com/reference/v2/orders-api/get-order",
+			"type": "text/html"
+		}
+	}
+}`
+
+// CancelOrderResponse example response of cancel order
+const CancelOrderResponse = `{
+	"resource": "order",
+	"id": "ord_8wmqcHMN4U",
+	"profileId": "pfl_URR55HPMGx",
+	"amount": {
+		"value": "1027.99",
+		"currency": "EUR"
+	},
+	"status": "canceled",
+	"isCancelable": false,
+	"metadata": null,
+	"createdAt": "2018-08-02T09:29:56+00:00",
+	"mode": "live",
+	"locale": "nl_NL",
+	"billingAddress": {
+		"organizationName": "Mollie B.V.",
+		"streetAndNumber": "Keizersgracht 313",
+		"postalCode": "1016 EE",
+		"city": "Amsterdam",
+		"country": "nl",
+		"givenName": "Luke",
+		"familyName": "Skywalker",
+		"email": "luke@skywalker.com"
+	},
+	"orderNumber": "18475",
+	"shippingAddress": {
+		"organizationName": "Mollie B.V.",
+		"streetAndNumber": "Keizersgracht 313",
+		"postalCode": "1016 EE",
+		"city": "Amsterdam",
+		"country": "nl",
+		"givenName": "Luke",
+		"familyName": "Skywalker",
+		"email": "luke@skywalker.com"
+	},
+	"canceledAt": "2018-08-03T09:29:56+00:00",
+	"redirectUrl": "https://example.org/redirect",
+	"lines": [
+		{
+			"resource": "orderline",
+			"id": "odl_dgtxyl",
+			"orderId": "ord_pbjz8x",
+			"name": "LEGO 42083 Bugatti Chiron",
+			"sku": "5702016116977",
+			"type": "physical",
+			"status": "canceled",
+			"metadata": null,
+			"isCancelable": false,
+			"quantity": 2,
+			"quantityShipped": 0,
+			"amountShipped": {
+				"value": "0.00",
+				"currency": "EUR"
+			},
+			"quantityRefunded": 0,
+			"amountRefunded": {
+				"value": "0.00",
+				"currency": "EUR"
+			},
+			"quantityCanceled": 2,
+			"amountCanceled": {
+				"value": "698.00",
+				"currency": "EUR"
+			},
+			"shippableQuantity": 0,
+			"refundableQuantity": 0,
+			"cancelableQuantity": 0,
+			"unitPrice": {
+				"value": "399.00",
+				"currency": "EUR"
+			},
+			"vatRate": "21.00",
+			"vatAmount": {
+				"value": "121.14",
+				"currency": "EUR"
+			},
+			"discountAmount": {
+				"value": "100.00",
+				"currency": "EUR"
+			},
+			"totalAmount": {
+				"value": "698.00",
+				"currency": "EUR"
+			},
+			"createdAt": "2018-08-02T09:29:56+00:00",
+			"_links": {
+				"productUrl": {
+					"href": "https://shop.lego.com/nl-NL/Bugatti-Chiron-42083",
+					"type": "text/html"
+				},
+				"imageUrl": {
+					"href": "https://sh-s7-live-s.legocdn.com/is/image//LEGO/42083_alt1?$main$",
+					"type": "text/html"
+				}
+			}
+		},
+		{
+			"resource": "orderline",
+			"id": "odl_jp31jz",
+			"orderId": "ord_pbjz8x",
+			"name": "LEGO 42056 Porsche 911 GT3 RS",
+			"sku": "5702015594028",
+			"type": "physical",
+			"status": "canceled",
+			"metadata": null,
+			"isCancelable": false,
+			"quantity": 1,
+			"quantityShipped": 0,
+			"amountShipped": {
+				"value": "0.00",
+				"currency": "EUR"
+			},
+			"quantityRefunded": 0,
+			"amountRefunded": {
+				"value": "0.00",
+				"currency": "EUR"
+			},
+			"quantityCanceled": 1,
+			"amountCanceled": {
+				"value": "329.99",
+				"currency": "EUR"
+			},
+			"shippableQuantity": 0,
+			"refundableQuantity": 0,
+			"cancelableQuantity": 0,
+			"unitPrice": {
+				"value": "329.99",
+				"currency": "EUR"
+			},
+			"vatRate": "21.00",
+			"vatAmount": {
+				"value": "57.27",
+				"currency": "EUR"
+			},
+			"totalAmount": {
+				"value": "329.99",
+				"currency": "EUR"
+			},
+			"createdAt": "2018-08-02T09:29:56+00:00",
+			"_links": {
+				"productUrl": {
+					"href": "https://shop.lego.com/nl-NL/Porsche-911-GT3-RS-42056",
+					"type": "text/html"
+				},
+				"imageUrl": {
+					"href": "https://sh-s7-live-s.legocdn.com/is/image/LEGO/42056?$PDPDefault$",
+					"type": "text/html"
+				}
+			}
+		}
+	],
+	"_links": {
+		"self": {
+			"href": "https://api.mollie.com/v2/orders/ord_pbjz8x",
+			"type": "application/hal+json"
+		},
+		"checkout": {
+			"href": "https://www.mollie.com/payscreen/order/checkout/pbjz8x",
+			"type": "text/html"
+		},
+		"documentation": {
+			"href": "https://docs.mollie.com/reference/v2/orders-api/get-order",
+			"type": "text/html"
+		}
+	}
+}`
+
+// OrderListResponse example response of list orders
+const OrderListResponse = `{
+    "count": 3,
+    "_embedded": {
+        "orders": [
+            {
+                "resource": "order",
+                "id": "ord_kEn1PlbGa",
+                "...": "..."
+            },
+            { },
+            { }
+        ]
+    },
+    "_links": {
+        "self": {
+            "href": "https://api.mollie.com/v2/orders",
+            "type": "application/hal+json"
+        },
+        "previous": null,
+        "next": {
+            "href": "https://api.mollie.com/v2/orders?from=ord_stTC2WHAuS",
+            "type": "application/hal+json"
+        },
+        "documentation": {
+            "href": "https://docs.mollie.com/reference/v2/orders-api/list-orders",
+            "type": "text/html"
+        }
+    }
+}`
+
+// UpdateOrderlineRequest example request of update orderline
+const UpdateOrderlineRequest = `{
+	"name": "LEGO 71043 Hogwarts™ Castle",
+	"productUrl": "https://shop.lego.com/en-GB/product/Hogwarts-Castle-71043",
+	"imageUrl": "https://sh-s7-live-s.legocdn.com/is/image//LEGO/71043_alt1?$main$",
+	"quantity": 2,
+	"vatRate": "21.00",
+	"unitPrice": {
+	   "currency": "EUR",
+	   "value": "349.00"
+	},
+	"totalAmount": {
+	   "currency": "EUR",
+	   "value": "598.00"
+	},
+	"discountAmount": {
+	   "currency": "EUR",
+	   "value": "100.00"
+	},
+	"vatAmount": {
+	   "currency": "EUR",
+	   "value": "103.79"
+	}
+}`
+
+// UpdateOrderlineResponse example response of update orderline
+const UpdateOrderlineResponse = `{
+	"resource":"order",
+	"id":"ord_pbjz8x",
+	"profileId":"pfl_URR55HPMGx",
+	"method":"ideal",
+	"amount":{
+	   "value":"927.99",
+	   "currency":"EUR"
+	},
+	"status":"created",
+	"isCancelable":true,
+	"metadata":null,
+	"createdAt":"2018-08-02T09:29:56+00:00",
+	"expiresAt":"2018-08-30T09:29:56+00:00",
+	"mode":"live",
+	"locale":"nl_NL",
+	"billingAddress":{
+	   "organizationName":"Mollie B.V.",
+	   "streetAndNumber":"Keizersgracht 313",
+	   "city":"Amsterdam",
+	   "region":"Noord-Holland",
+	   "postalCode":"1234AB",
+	   "country":"NL",
+	   "title":"Dhr",
+	   "givenName":"Piet",
+	   "familyName":"Mondriaan",
+	   "email":"piet@mondriaan.com",
+	   "phone":"+31208202070"
+	},
+	"orderNumber":"18475",
+	"shippingAddress":{
+	   "organizationName":"Mollie B.V.",
+	   "streetAndNumber":"Keizersgracht 313",
+	   "postalCode":"1016 EE",
+	   "city":"Amsterdam",
+	   "country":"nl",
+	   "givenName":"Luke",
+	   "familyName":"Skywalker",
+	   "email":"luke@skywalker.com"
+	},
+	"redirectUrl":"https://example.org/redirect",
+	"lines":[
+	   {
+		  "resource":"orderline",
+		  "id":"odl_dgtxyl",
+		  "orderId":"ord_pbjz8x",
+		  "name":"LEGO 71043 Hogwarts™ Castle",
+		  "sku":"5702016116977",
+		  "type":"physical",
+		  "status":"created",
+		  "metadata":null,
+		  "isCancelable":false,
+		  "quantity":2,
+		  "quantityShipped":0,
+		  "amountShipped":{
+			 "value":"0.00",
+			 "currency":"EUR"
+		  },
+		  "quantityRefunded":0,
+		  "amountRefunded":{
+			 "value":"0.00",
+			 "currency":"EUR"
+		  },
+		  "quantityCanceled":0,
+		  "amountCanceled":{
+			 "value":"0.00",
+			 "currency":"EUR"
+		  },
+		  "shippableQuantity":0,
+		  "refundableQuantity":0,
+		  "cancelableQuantity":0,
+		  "unitPrice":{
+			 "currency":"EUR",
+			 "value":"349.00"
+		  },
+		  "totalAmount":{
+			 "currency":"EUR",
+			 "value":"598.00"
+		  },
+		  "discountAmount":{
+			 "currency":"EUR",
+			 "value":"100.00"
+		  },
+		  "vatAmount":{
+			 "currency":"EUR",
+			 "value":"103.79"
+		  },
+		  "createdAt":"2018-08-02T09:29:56+00:00",
+		  "_links":{
+			 "productUrl":{
+				"href":"https://shop.lego.com/en-GB/product/Hogwarts-Castle-71043",
+				"type":"text/html"
+			 },
+			 "imageUrl":{
+				"href":"https://sh-s7-live-s.legocdn.com/is/image//LEGO/71043_alt1?$main$",
+				"type":"text/html"
+			 }
+		  }
+	   },
+	   {
+		  "resource":"orderline",
+		  "id":"odl_jp31jz",
+		  "orderId":"ord_pbjz8x",
+		  "name":"LEGO 42056 Porsche 911 GT3 RS",
+		  "sku":"5702015594028",
+		  "type":"physical",
+		  "status":"created",
+		  "metadata":null,
+		  "isCancelable":false,
+		  "quantity":1,
+		  "quantityShipped":0,
+		  "amountShipped":{
+			 "value":"0.00",
+			 "currency":"EUR"
+		  },
+		  "quantityRefunded":0,
+		  "amountRefunded":{
+			 "value":"0.00",
+			 "currency":"EUR"
+		  },
+		  "quantityCanceled":0,
+		  "amountCanceled":{
+			 "value":"0.00",
+			 "currency":"EUR"
+		  },
+		  "shippableQuantity":0,
+		  "refundableQuantity":0,
+		  "cancelableQuantity":0,
+		  "unitPrice":{
+			 "value":"329.99",
+			 "currency":"EUR"
+		  },
+		  "vatRate":"21.00",
+		  "vatAmount":{
+			 "value":"57.27",
+			 "currency":"EUR"
+		  },
+		  "totalAmount":{
+			 "value":"329.99",
+			 "currency":"EUR"
+		  },
+		  "createdAt":"2018-08-02T09:29:56+00:00",
+		  "_links":{
+			 "productUrl":{
+				"href":"https://shop.lego.com/nl-NL/Porsche-911-GT3-RS-42056",
+				"type":"text/html"
+			 },
+			 "imageUrl":{
+				"href":"https://sh-s7-live-s.legocdn.com/is/image/LEGO/42056?$PDPDefault$",
+				"type":"text/html"
+			 }
+		  }
+	   }
+	],
+	"_links":{
+	   "self":{
+		  "href":"https://api.mollie.com/v2/orders/ord_pbjz8x",
+		  "type":"application/hal+json"
+	   },
+	   "checkout":{
+		  "href":"https://www.mollie.com/payscreen/order/checkout/pbjz8x",
+		  "type":"text/html"
+	   },
+	   "documentation":{
+		  "href":"https://docs.mollie.com/reference/v2/orders-api/get-order",
+		  "type":"text/html"
+	   }
+	}
+ }`
+
+// CancelOrderLinesRequest example
+const CancelOrderLinesRequest = `{
+	"lines": [
+	   {
+		  "id": "odl_dgtxyl",
+		  "quantity": 1
+	   },
+	   {
+		  "id": "odl_jp31jz"
+	   }
+	]
+}`
+
+// CancelOrderLinesRequest example
+const CancelOrderLinesRejectRequest = `{
+	"lines": [
+	   {
+		  "id": "odl_dgtwkn",
+		  "quantity": 1
+	   },
+	   {
+		  "id": "odl_jp31jz"
+	   }
+	]
+}`
+
+// CancelOrderLinesResponseAmountRequired example
+const CancelOrderLinesResponseAmountRequired = `{
+	"status": 422,
+	"title": "Unprocessable Entity",
+	"detail": "Line 0 contains invalid data. An amount is required for this API call. The amount must be between €0.00 and €50.00.",
+	"field": "lines.0.amount",
+	"extra": {
+		"minimumAmount": {
+			"value": "0.00",
+			"currency": "EUR"
+		},
+		"maximumAmount": {
+			"value": "50.00",
+			"currency": "EUR"
+		}
+	},
+	"_links": {
+		"documentation": {
+			"href": "https://docs.mollie.com/reference/v2/orders-api/cancel-order-lines",
+			"type": "text/html"
+		}
+	}
+}`
+
+// CancelOrderLinesResponseCancelReject example
+const CancelOrderLinesResponseCancelReject = `{
+    "status": 422,
+    "title": "Unprocessable Entity",
+    "detail": "Update authorization not allowed. Decision is based on order state and outcome of risk assessment.",
+    "_links": {
+        "documentation": {
+            "href": "https://docs.mollie.com/guides/handling-errors",
+            "type": "text/html"
+        }
+    }
+}`
+
+// CreateOrderPaymentRequest example request
+const CreateOrderPaymentRequest = `{
+	"method": "banktransfer"
+}`
+
+// CreateOrderPaymentResponse example response
+const CreateOrderPaymentResponse = `{
+    "resource": "payment",
+    "id": "tr_WDqYK6vllg",
+    "mode": "test",
+    "amount": {
+        "currency": "EUR",
+        "value": "698.00"
+    },
+    "status": "open",
+    "description": "Order #1337 (Lego cars)",
+    "createdAt": "2018-12-01T17:09:02+00:00",
+    "method": "banktransfer",
+    "metadata": null,
+    "orderId": "ord_stTC2WHAuS",
+    "isCancelable": true,
+    "locale": "nl_NL",
+    "profileId": "pfl_URR55HPMGx",
+    "sequenceType": "oneoff",
+    "settlementAmount": {
+        "value": "698.00",
+        "currency": "EUR"
+    },
+    "_links": {
+        "self": {
+            "href": "https://api.mollie.com/v2/payments/tr_WDqYK6vllg",
+            "type": "application/hal+json"
+        },
+        "order": {
+            "href": "https://api.mollie.com/v2/orders/ord_stTC2WHAuS",
+            "type": "application/hal+json"
+        },
+        "checkout": {
+            "href": "https://www.mollie.com/paymentscreen/testmode/?method=banktransfer&token=fgnwdh",
+            "type": "text/html"
+        },
+        "status": {
+            "href": "https://www.mollie.com/paymentscreen/banktransfer/status/fgnwdh",
+            "type": "text/html"
+        },
+        "payOnline": {
+            "href": "https://www.mollie.com/paymentscreen/banktransfer/pay-online/fgnwdh",
+            "type": "text/html"
+        },
+        "documentation": {
+            "href": "https://docs.mollie.com/reference/v2/orders-api/create-order-payment",
+            "type": "text/html"
+        }
+    }
+}`
+
+// CreateOrderPaymentResponseFailed example response
+const CreateOrderPaymentResponseFailed = `{
+	"status": 422,
+	"title": "Unprocessable Entity",
+	"detail": "Cannot create a new payment for order ord_stTC2WHAuS when the order status is \"completed\".",
+	"_links": {
+		"documentation": {
+			"href": "https://docs.mollie.com/reference/v2/orders-api/create-order-payment",
+			"type": "text/html"
+		}
+	}
+}`
+
+// CreateOrderRefundRequest example
+const CreateOrderRefundRequest = `{
+	"lines": [
+	   {
+		  "id": "odl_dgtxyl",
+		  "quantity": 1
+	   }
+	],
+	"description": "Required quantity not in stock, refunding one photo book.",
+	"metadata": {
+	   "bookkeeping_id": 12345
+	}
+}`
+
+// CreateOrderRefundResponse example
+const CreateOrderRefundResponse = `{
+    "resource": "refund",
+    "id": "re_4qqhO89gsT",
+    "amount": {
+        "currency": "EUR",
+        "value": "698.00"
+    },
+    "status": "pending",
+    "createdAt": "2018-03-14T17:09:02.0Z",
+    "description": "Required quantity not in stock, refunding one photo book.",
+    "metadata": {
+         "bookkeeping_id": 12345
+    },
+    "paymentId": "tr_WDqYK6vllg",
+    "orderId": "ord_stTC2WHAuS",
+    "lines": [
+        {
+            "resource": "orderline",
+            "id": "odl_dgtxyl",
+            "orderId": "ord_stTC2WHAuS",
+            "name": "LEGO 42083 Bugatti Chiron",
+            "sku": "5702016116977",
+            "type": "physical",
+            "status": "paid",
+            "metadata": null,
+            "quantity": 1,
+            "unitPrice": {
+                "value": "399.00",
+                "currency": "EUR"
+            },
+            "vatRate": "21.00",
+            "vatAmount": {
+                "value": "51.89",
+                "currency": "EUR"
+            },
+            "discountAmount": {
+                "value": "100.00",
+                "currency": "EUR"
+            },
+            "totalAmount": {
+                "value": "299.00",
+                "currency": "EUR"
+            },
+            "createdAt": "2018-08-02T09:29:56+00:00",
+            "_links": {
+                "productUrl": {
+                    "href": "https://shop.lego.com/nl-NL/Bugatti-Chiron-42083",
+                    "type": "text/html"
+                },
+                "imageUrl": {
+                    "href": "https://sh-s7-live-s.legocdn.com/is/image//LEGO/42083_alt1?$main$",
+                    "type": "text/html"
+                }
+            }
+        }
+    ],
+    "_links": {
+        "self": {
+            "href": "https://api.mollie.com/v2/payments/tr_WDqYK6vllg/refunds/re_4qqhO89gsT",
+            "type": "application/hal+json"
+        },
+        "payment": {
+            "href": "https://api.mollie.com/v2/payments/tr_WDqYK6vllg",
+            "type": "application/hal+json"
+        },
+        "order": {
+            "href": "https://api.mollie.com/v2/orders/ord_stTC2WHAuS",
+            "type": "application/hal+json"
+        },
+        "documentation": {
+            "href": "https://docs.mollie.com/reference/v2/orders-api/create-order-refund",
+            "type": "text/html"
+        }
+    }
+}`
+
+// CreateOrderRefundResponseFailed example
+const CreateOrderRefundResponseFailed = `{
+	"status": 422,
+	"title": "Unprocessable Entity",
+	"detail": "Line 0 contains invalid data. An amount is required for this API call. The amount must be between €0.00 and €50.00.",
+	"field": "lines.0.amount",
+	"extra": {
+		"minimumAmount": {
+			"value": "0.00",
+			"currency": "EUR"
+		},
+		"maximumAmount": {
+			"value": "50.00",
+			"currency": "EUR"
+		}
+	},
+	"_links": {
+		"documentation": {
+			"href": "https://docs.mollie.com/reference/v2/orders-api/create-order-refund",
+			"type": "text/html"
+		}
+	}
+}`
+
+// ListOrderRefundResponse example
+const ListOrderRefundResponse = `{
+    "count": 1,
+    "_embedded": {
+        "refunds": [
+            {
+                "resource": "refund",
+                "id": "re_4qqhO89gsT",
+                "amount": {
+                    "currency": "EUR",
+                    "value": "698.00"
+                },
+                "status": "processing",
+                "createdAt": "2018-03-14T17:09:02.0Z",
+                "description": "Required quantity not in stock, refunding one photo book.",
+                "metadata": {
+                     "bookkeeping_id": 12345
+                },
+                "paymentId": "tr_WDqYK6vllg",
+                "orderId": "ord_stTC2WHAuS",
+                "lines": [
+                    {
+                        "resource": "orderline",
+                        "id": "odl_dgtxyl",
+                        "orderId": "ord_stTC2WHAuS",
+                        "name": "LEGO 42083 Bugatti Chiron",
+                        "sku": "5702016116977",
+                        "type": "physical",
+                        "status": "paid",
+                        "metadata": null,
+                        "quantity": 1,
+                        "unitPrice": {
+                            "value": "399.00",
+                            "currency": "EUR"
+                        },
+                        "vatRate": "21.00",
+                        "vatAmount": {
+                            "value": "51.89",
+                            "currency": "EUR"
+                        },
+                        "discountAmount": {
+                            "value": "100.00",
+                            "currency": "EUR"
+                        },
+                        "totalAmount": {
+                            "value": "299.00",
+                            "currency": "EUR"
+                        },
+                        "createdAt": "2018-08-02T09:29:56+00:00",
+                        "_links": {
+                            "productUrl": {
+                                "href": "https://shop.lego.com/nl-NL/Bugatti-Chiron-42083",
+                                "type": "text/html"
+                            },
+                            "imageUrl": {
+                                "href": "https://sh-s7-live-s.legocdn.com/is/image//LEGO/42083_alt1?$main$",
+                                "type": "text/html"
+                            }
+                        }
+                    }
+                ],
+                "_links": {
+                    "self": {
+                        "href": "https://api.mollie.com/v2/payments/tr_WDqYK6vllg/refunds/re_4qqhO89gsT",
+                        "type": "application/hal+json"
+                    },
+                    "payment": {
+                        "href": "https://api.mollie.com/v2/payments/tr_WDqYK6vllg",
+                        "type": "application/hal+json"
+                    },
+                    "order": {
+                        "href": "https://api.mollie.com/v2/orders/ord_stTC2WHAuS",
+                        "type": "application/hal+json"
+                    },
+                    "documentation": {
+                        "href": "https://docs.mollie.com/reference/v2/refunds-api/get-refund",
+                        "type": "text/html"
+                    }
+                }
+            }
+        ]
+    },
+    "_links": {
+        "self": {
+            "href": "https://api.mollie.com/v2/payments/tr_7UhSN1zuXS/refunds?limit=5",
+            "type": "application/hal+json"
+        },
+        "previous": null,
+        "next": {
+            "href": "https://api.mollie.com/v2/payments/tr_7UhSN1zuXS/refunds?from=re_APBiGPH2vV&limit=5",
+            "type": "application/hal+json"
+        },
+        "documentation": {
+            "href": "https://docs.mollie.com/reference/v2/orders-api/list-order-refunds",
+            "type": "text/html"
+        }
+    }
+}`