createPaymentOrder method

Future<Object?> createPaymentOrder({
  1. Map<String, Object?>? query,
  2. Object? body,
  3. Map<String, String>? headers,
})

POST /{version}/payments/orders

Creates a payment order for a buyer. The body carries buyerUserId, merchantReference, currency, priceVersion, lines (each {sku?, title?, quantity, unitAmountMinor}), and optionally idempotencyKey and metadata (a string map).

Answers IdResponse — { "id": "ord_…" }. The same body sent again with the same idempotencyKey answers the same id (no second order).

Implementation

Future<Object?> createPaymentOrder(
    {Map<String, Object?>? query,
    Object? body,
    Map<String, String>? headers}) {
  return transport.send(
    route: '/{version}/payments/orders',
    method: 'POST',
    query: query,
    body: body,
    headers: headers,
    pathParams: null,
  );
}