Skip to content

Latest commit

 

History

History
423 lines (298 loc) · 16.2 KB

OrdersApi.md

File metadata and controls

423 lines (298 loc) · 16.2 KB

conekta.api.OrdersApi

Load the API package

import 'package:conekta/api.dart';

All URIs are relative to https://api.conekta.io

Method HTTP request Description
cancelOrder POST /orders/{id}/cancel Cancel Order
createOrder POST /orders Create order
getOrderById GET /orders/{id} Get Order
getOrders GET /orders Get a list of Orders
orderCancelRefund DELETE /orders/{id}/refunds/{refund_id} Cancel Refund
orderRefund POST /orders/{id}/refunds Refund Order
ordersCreateCapture POST /orders/{id}/capture Capture Order
updateOrder PUT /orders/{id} Update Order

cancelOrder

OrderResponse cancelOrder(id, acceptLanguage, xChildCompanyId)

Cancel Order

Cancel an order that has been previously created.

Example

import 'package:conekta/api.dart';

final api = Conekta().getOrdersApi();
final String id = 6307a60c41de27127515a575; // String | Identifier of the resource
final String acceptLanguage = es; // String | Use for knowing which language to use
final String xChildCompanyId = 6441b6376b60c3a638da80af; // String | In the case of a holding company, the company id of the child company to which will process the request.

try {
    final response = api.cancelOrder(id, acceptLanguage, xChildCompanyId);
    print(response);
} catch on DioException (e) {
    print('Exception when calling OrdersApi->cancelOrder: $e\n');
}

Parameters

Name Type Description Notes
id String Identifier of the resource
acceptLanguage String Use for knowing which language to use [optional] [default to 'es']
xChildCompanyId String In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

OrderResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.1.0+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createOrder

OrderResponse createOrder(orderRequest, acceptLanguage, xChildCompanyId)

Create order

Create a new order.

Example

import 'package:conekta/api.dart';

final api = Conekta().getOrdersApi();
final OrderRequest orderRequest = ; // OrderRequest | requested field for order
final String acceptLanguage = es; // String | Use for knowing which language to use
final String xChildCompanyId = 6441b6376b60c3a638da80af; // String | In the case of a holding company, the company id of the child company to which will process the request.

try {
    final response = api.createOrder(orderRequest, acceptLanguage, xChildCompanyId);
    print(response);
} catch on DioException (e) {
    print('Exception when calling OrdersApi->createOrder: $e\n');
}

Parameters

Name Type Description Notes
orderRequest OrderRequest requested field for order
acceptLanguage String Use for knowing which language to use [optional] [default to 'es']
xChildCompanyId String In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

OrderResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/vnd.conekta-v2.1.0+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getOrderById

OrderResponse getOrderById(id, acceptLanguage, xChildCompanyId)

Get Order

Info for a specific order

Example

import 'package:conekta/api.dart';

final api = Conekta().getOrdersApi();
final String id = 6307a60c41de27127515a575; // String | Identifier of the resource
final String acceptLanguage = es; // String | Use for knowing which language to use
final String xChildCompanyId = 6441b6376b60c3a638da80af; // String | In the case of a holding company, the company id of the child company to which will process the request.

try {
    final response = api.getOrderById(id, acceptLanguage, xChildCompanyId);
    print(response);
} catch on DioException (e) {
    print('Exception when calling OrdersApi->getOrderById: $e\n');
}

Parameters

Name Type Description Notes
id String Identifier of the resource
acceptLanguage String Use for knowing which language to use [optional] [default to 'es']
xChildCompanyId String In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

OrderResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.1.0+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getOrders

GetOrdersResponse getOrders(acceptLanguage, xChildCompanyId, limit, search, next, previous, paymentStatus, lastPaymentInfoPeriodStatus, createdAt, createdAtPeriodGte, createdAtPeriodLte, updatedAtPeriodGte, updatedAtPeriodLte)

Get a list of Orders

Get order details in the form of a list

Example

import 'package:conekta/api.dart';

final api = Conekta().getOrdersApi();
final String acceptLanguage = es; // String | Use for knowing which language to use
final String xChildCompanyId = 6441b6376b60c3a638da80af; // String | In the case of a holding company, the company id of the child company to which will process the request.
final int limit = 56; // int | The numbers of items to return, the maximum value is 250
final String search = search_example; // String | General order search, e.g. by mail, reference etc.
final String next = next_example; // String | next page
final String previous = previous_example; // String | previous page
final String paymentStatus = paid; // String | Filters by order status
final String lastPaymentInfoPeriodStatus = pending_payment; // String | Filters by last payment info status
final int createdAt = 1612137600; // int | created equal to
final int createdAtPeriodGte = 1612137600; // int | created at greater than or equal to
final int createdAtPeriodLte = 1612137600; // int | created at less than or equal to
final int updatedAtPeriodGte = 1612137600; // int | updated at greater than or equal to
final int updatedAtPeriodLte = 1612137600; // int | updated at less than or equal to

try {
    final response = api.getOrders(acceptLanguage, xChildCompanyId, limit, search, next, previous, paymentStatus, lastPaymentInfoPeriodStatus, createdAt, createdAtPeriodGte, createdAtPeriodLte, updatedAtPeriodGte, updatedAtPeriodLte);
    print(response);
} catch on DioException (e) {
    print('Exception when calling OrdersApi->getOrders: $e\n');
}

Parameters

Name Type Description Notes
acceptLanguage String Use for knowing which language to use [optional] [default to 'es']
xChildCompanyId String In the case of a holding company, the company id of the child company to which will process the request. [optional]
limit int The numbers of items to return, the maximum value is 250 [optional] [default to 20]
search String General order search, e.g. by mail, reference etc. [optional]
next String next page [optional]
previous String previous page [optional]
paymentStatus String Filters by order status [optional]
lastPaymentInfoPeriodStatus String Filters by last payment info status [optional]
createdAt int created equal to [optional]
createdAtPeriodGte int created at greater than or equal to [optional]
createdAtPeriodLte int created at less than or equal to [optional]
updatedAtPeriodGte int updated at greater than or equal to [optional]
updatedAtPeriodLte int updated at less than or equal to [optional]

Return type

GetOrdersResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.1.0+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

orderCancelRefund

OrderResponse orderCancelRefund(id, refundId, acceptLanguage, xChildCompanyId)

Cancel Refund

A refunded order describes the items, amount, and reason an order is being refunded.

Example

import 'package:conekta/api.dart';

final api = Conekta().getOrdersApi();
final String id = 6307a60c41de27127515a575; // String | Identifier of the resource
final String refundId = 6407b5bee1329a000175ba11; // String | refund identifier
final String acceptLanguage = es; // String | Use for knowing which language to use
final String xChildCompanyId = 6441b6376b60c3a638da80af; // String | In the case of a holding company, the company id of the child company to which will process the request.

try {
    final response = api.orderCancelRefund(id, refundId, acceptLanguage, xChildCompanyId);
    print(response);
} catch on DioException (e) {
    print('Exception when calling OrdersApi->orderCancelRefund: $e\n');
}

Parameters

Name Type Description Notes
id String Identifier of the resource
refundId String refund identifier
acceptLanguage String Use for knowing which language to use [optional] [default to 'es']
xChildCompanyId String In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

OrderResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.1.0+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

orderRefund

OrderResponse orderRefund(id, orderRefundRequest, acceptLanguage, xChildCompanyId)

Refund Order

A refunded order describes the items, amount, and reason an order is being refunded.

Example

import 'package:conekta/api.dart';

final api = Conekta().getOrdersApi();
final String id = 6307a60c41de27127515a575; // String | Identifier of the resource
final OrderRefundRequest orderRefundRequest = ; // OrderRefundRequest | requested field for a refund
final String acceptLanguage = es; // String | Use for knowing which language to use
final String xChildCompanyId = 6441b6376b60c3a638da80af; // String | In the case of a holding company, the company id of the child company to which will process the request.

try {
    final response = api.orderRefund(id, orderRefundRequest, acceptLanguage, xChildCompanyId);
    print(response);
} catch on DioException (e) {
    print('Exception when calling OrdersApi->orderRefund: $e\n');
}

Parameters

Name Type Description Notes
id String Identifier of the resource
orderRefundRequest OrderRefundRequest requested field for a refund
acceptLanguage String Use for knowing which language to use [optional] [default to 'es']
xChildCompanyId String In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

OrderResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/vnd.conekta-v2.1.0+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ordersCreateCapture

OrderResponse ordersCreateCapture(id, acceptLanguage, xChildCompanyId, orderCaptureRequest)

Capture Order

Processes an order that has been previously authorized.

Example

import 'package:conekta/api.dart';

final api = Conekta().getOrdersApi();
final String id = 6307a60c41de27127515a575; // String | Identifier of the resource
final String acceptLanguage = es; // String | Use for knowing which language to use
final String xChildCompanyId = 6441b6376b60c3a638da80af; // String | In the case of a holding company, the company id of the child company to which will process the request.
final OrderCaptureRequest orderCaptureRequest = ; // OrderCaptureRequest | requested fields for capture order

try {
    final response = api.ordersCreateCapture(id, acceptLanguage, xChildCompanyId, orderCaptureRequest);
    print(response);
} catch on DioException (e) {
    print('Exception when calling OrdersApi->ordersCreateCapture: $e\n');
}

Parameters

Name Type Description Notes
id String Identifier of the resource
acceptLanguage String Use for knowing which language to use [optional] [default to 'es']
xChildCompanyId String In the case of a holding company, the company id of the child company to which will process the request. [optional]
orderCaptureRequest OrderCaptureRequest requested fields for capture order [optional]

Return type

OrderResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/vnd.conekta-v2.1.0+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateOrder

OrderResponse updateOrder(id, orderUpdateRequest, acceptLanguage)

Update Order

Update an existing Order.

Example

import 'package:conekta/api.dart';

final api = Conekta().getOrdersApi();
final String id = 6307a60c41de27127515a575; // String | Identifier of the resource
final OrderUpdateRequest orderUpdateRequest = ; // OrderUpdateRequest | requested field for an order
final String acceptLanguage = es; // String | Use for knowing which language to use

try {
    final response = api.updateOrder(id, orderUpdateRequest, acceptLanguage);
    print(response);
} catch on DioException (e) {
    print('Exception when calling OrdersApi->updateOrder: $e\n');
}

Parameters

Name Type Description Notes
id String Identifier of the resource
orderUpdateRequest OrderUpdateRequest requested field for an order
acceptLanguage String Use for knowing which language to use [optional] [default to 'es']

Return type

OrderResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/vnd.conekta-v2.1.0+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]