Last updated

Puchase trial

A purchase trial forms the first phase of the direct-top airtime message flow. It is used to validate the originating entity, customer's MSISDN, and the selected product.

Note

The purchase trial step exists to validate certain details to help ensure a successful purchase. However, it is not a hard requirement that this step returns a successful response in order to continue to the purchase request.

A typical example would be the case of the error response FUNCTION_NOT_SUPPORTED. This would be returned by the Electrum API in the case of a service provider not supporting a validation step. The originating system may then proceed directly to the purchase request.

Operations and Messages

TransactionOperationAPI Calls
Purchase trialpurchaseTrial

Message Flows

The sections below describe a successful purchase trial and possible error scenarios.

Successful Purchase Trial

See 'Validation Phase' of the diagram below.

  1. The originating system sends a POST call to the /purchases/trials API endpoint.
  2. The API responds with an HTTP status of 200 and a PurchaseResponse payload.
  3. The consumer can decide whether or not to proceed with tender and an actual purchase.

alt text

Error at Originating System

  1. The originating system sends a POST call to the /purchases/trials API endpoint.
  2. An error occurs at the originating system, or a timeout occurs when the originating system does not receive a response.
  3. No further messaging is required.

alt text

Error Upstream

  1. The originating system sends a POST call to the /purchases/trials API endpoint.
  2. An error occurs at Electrum or the service provider.
  3. The API returns an HTTP status of 400, 500, 503 or 504 and an ErrorDetail message payload.
  4. No further messaging is required. Depending on the nature of the error, the originating system can retry the trial purchase, abort the transaction, or proceed to an airtime purchase after tender by the consumer.
Note
  • In general, an HTTP status 400 indicates that the request failed permanently and cannot be retried without changing the message content.
  • HTTP statuses in the 5xx range are typically temporary system or communication failures, in which case the transaction can be retried.
  • An error of TRANSACTION_NOT_SUPPORTED indicates that the service provider does not support purchase trials. The originating system can proceed to a purchase transaction.

alt text