import { HttpRequest, Response } from '../../../http-request'; import { UpdateMerchantReferenceBody } from './interface'; export class Orders extends HttpRequest { /** * https://developers.klarna.com/api/#order-management-api-acknowledge-order */ acknowledge(orderId: string): Promise { return this.invoke( `POST`, `/ordermanagement/v1/orders/${orderId}/acknowledge` ); } /** * https://developers.klarna.com/api/#order-management-api-cancel-order */ cancel(orderId: string): Promise { return this.invoke( `POST`, `/ordermanagement/v1/orders/${orderId}/cancel`, {} ); } /** * https://developers.klarna.com/api/#order-management-api-release-remaining-authorization */ releaseRemainingAuthorization(orderId: string): Promise { return this.invoke( `POST`, `/ordermanagement/v1/orders/${orderId}/release-remaining-authorization`, {} ); } /** * https://developers.klarna.com/api/#order-management-api-update-merchant-references */ updateMerchantReference( orderId: string, body: UpdateMerchantReferenceBody ): Promise { return this.invoke( `PATCH`, `/ordermanagement/v1/orders/${orderId}/merchant-references`, body ); } getOrder(orderId: string): Promise { return this.invoke(`GET`, `/ordermanagement/v1/orders/${orderId}`); } }