Services

Accept or pay an order

Accept (approve without payment), pay by gateway, or pay from balance an existing service order on behalf of the authenticated main (LBA) account. Mirrors the website order flow.

The acting customer is taken from the access token. A main account may act on its own order or on an aggregated sub-account's order awaiting its approval; a sub-account caller is rejected for any type.

Action types (type):

  • accept — approve the order without payment. Allowed only when the order cannot be paid (the payment gateway is disabled or the order is free, or there are no payment entry points and the balance does not cover the total). Otherwise responds with INVALID_INPUT_DATA asking to pay.

  • order_with_payment — requires entry_point_id. Returns payment_url (opened in the WebView); the embedded callback_data carries the result_url the gateway redirects to on completion. Does not change the order.

  • order_with_account_balance — pays from the account balance; if the balance does not cover the total, responds with INVALID_INPUT_DATA. On success returns result, order_id and price.

Possible errors

  • INVALID_INPUT_DATA (422) — validation failed, sub-account caller, order cannot be processed in its current status, accept not allowed because the order is payable, or insufficient balance.

  • BAD_REQUEST (400) — entry_point_id is unknown or not available to the customer.

  • NOT_FOUND (404) — order does not exist, or does not belong to the caller (returned the same as not-found to prevent id enumeration).

  • FORBIDDEN (403) — the caller is not a customer.

post/portal/services/accept-order

Request

  • Base URL: https://demo.splynx.com/api/2.0
  • URL: https://demo.splynx.com/api/2.0/portal/services/accept-order
  • Auth: HTTP basic

Request body

order_idinteger

Existing order to accept or pay.

type'accept' | 'order_with_payment' | 'order_with_account_balance'

Action to perform.

entry_point_idinteger

Payment gateway entry point. Required for order_with_payment, not allowed for other types.

Response

order_idinteger
payment_urlstring

Gateway URL to open in the WebView. Returned for order_with_payment.

resultboolean

Returned for order_with_account_balance.

pricenumber

Charged amount. Returned for order_with_account_balance.

Changes

No recorded changes to this operation across all 1 revision of this API.