Conductor API Docs (2.3)

Download OpenAPI specification:Download

Introduction

Purpose

The aim of this document is to serve as a guideline for integrating to Moment’s Conductor API.

Overview

Moment’s Conductor API describes a set of APIs that enables partners to access multiple billers and merchants for payment processing.

Scope

The scope of this document encompasses the integration into Moment’s Conductor API.

Audience

The intended audience of this document includes product, architects, analysts, developers, project managers and other pertinent stakeholders.



Get Started

Access

The Conductor API offers a Sandbox and a Production instance. The Sandbox instances servers as a precursor for Production. Upon successful testing and certification in sandbox, Production access may then be requested by partners.

Authentication

The Conductor API uses a secret key to authenticate requests. Secret keys have the prefix sk_. Your secret key carries many privileges, so be sure to keep them secure. Don't share your secret key in publicly accessible areas such as GitHub, client-side code, and so forth. You can use your secret key in the following manner:

-H "Authorization: Bearer sk_RhKeWM4c1mB32CjwIdpfuqDJ"

You must make all API calls over HTTPS. Calls that you make over plain HTTP will fail. API requests without authentication will also fail.

Idempotency

The API supports idempotency for safely retrying requests without accidentally performing the same operation twice. When creating or updating an object, use an idempotency key. Then, if a connection error occurs, you can safely repeat the request without risk of creating a second object or performing the update twice.

To perform an idempotent request, provide an additional Idempotency-Key: <key> header to the request.

Conductor idempotency works by saving the resulting status code and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including 500 errors.

An idempotency key is a unique value generated by the client which the server uses to recognize subsequent retries of the same request. How you create unique keys is up to you, but we suggest using V4 UUIDs, or another random string with enough entropy to avoid collisions. Idempotency keys can be up to 255 characters long.

Results are only saved if an API endpoint started executing. If incoming parameters failed validation, or the request conflicted with another that was executing concurrently, no idempotent result is saved because no API endpoint began execution. It is safe to retry these requests

All POST requests accept idempotency keys. Sending idempotency keys in GET and DELETE requests has no effect and should be avoided, as these requests are idempotent by definition.

For idempotent requests, the API saves the status code and body of the response of the initial request and, when the same idempotency key is used in another request, it replays the saved response. This includes error responses such as 400 and 500 errors. The following validation is also performed for idempotent requests:

  • If the request parameters do not match the initial request, we will return an Unprocessable Entity error
  • If the initial request is still being processed concurrently and has not yet responded, we will return a Conflicterror

When a response is replayed, an Idempotent-Replayed: true header will be attached to the response.

Idempotency keys will be removed once they are at least 24 hours old, after which a key may be reused and will be processed as an initial request and response.

Sample request:

curl --location 'https://api.momentco.net/conductor/v1/transactions' \
--header 'Authorization: Bearer sk_RhKeWM4c1mB32CjwIdpfuqDJ' \
--header 'Idempotency-Key: g6378cb0-62b0-11ee-8c99-0242ac120003' \
--header 'Content-Type: application/json' \
--data '{
   "external_reference": "jvboay10o2",
    "items": [
        {
            "id": "bill_651574c0d016708b8b37b8ab",
            "amount": {
                "currency": "ZAR",
                "value": "20"
            }
        }
    ]
}'

Overview

Healthcheck

The Health Check API enables partners to check the operating status of the Conductor APIs. It serves as a ping or polling point for conductor API entry points to confirm the accessibility of the APIs. Further information can be found in the API operations section.

Product Catalogue

The conductor API provides a product catalogue that represents the various product catalogs that a biller offers. A Biller can have a category_code associated with it which can have multiple sub-categories and products within the same. A Product can have general product properties like code, name, description and may or may not have amount_rules, quantity_rules within it. A Category can have the following properties name, description, products, categories

Category Hierarchy

Category Hierarchy

Accounts

The accounts API serves to request the account details of a customer including the amount due and other associated bills. Additionally, it facilitates customer identifier verification. The API mandates authorization via header parameters, requiring the inclusion of the Retailer-Id, along with a request body. Within the request body, essential elements such as the biller_code (uniquely identifies the biller),, an identifier (uniquely identifies the customer to the biller) and a reference (uniquely identifies the biller’s product) are required. Further information can be found in the API operations section.

Transactions

The transaction APIs allow for creation, completion, cancellation and fetching of transactions. The operations under these groups of APIs include the Create Transaction, Complete Transaction, Cancel Transaction and Get transaction. Further information can be found in the API operations section.

Partners

Similar to the transaction APIs, the partner APIs offer partners the capability to create, complete, cancel and get transactions. The difference between the partner APIs and the transaction APIs, is that the partner APIs Create Transaction operation does not require items, the complete, cancel and get transaction operations use external_transaction_id instead of transaction_id. Further information can be found in the API operations section.

Create Order

The create order API enables partners to create an order based on products using the biller_code, identifier and product code. The create order API supports creating multiple orders in one API call . Further information can be found in the API operations section.

Errors

Conductor uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx range indicate an error with Conductor's servers (these are rare).

Status Code Type Detail
400 BAD_REQUEST Bad request
400 INVALID_BILLER_CODE Biller code is invalid
400 INACTIVE_BILLER_CODE Biller is inactive.
400 INVALID_IDENTIFIER Customer identifier is invalid.
400 INVALID_REFERENCE Reference is invalid.
400 INVALID_EXTERNAL_REFERENCE External reference has already been used
400 INVALID_ITEMS One or more items are invalid
400 INVALID_AMOUNT Amount in the request is invalid. Value should not contain non-numeric characters or negative value.
400 INVALID_CURRENCY Currency must adhere to the standard ISO 4217 format
400 INVALID_PAGE_SIZE Page size is invalid
400 INVALID_DEPTH Depth is invalid
400 INVALID_CATEGORY Category code is invalid
400 INVALID_PRODUCTS One or more products are invalid
400 CONFLICTED_ITEMS The bill and order cannot be processed together due to conflicting items or business rules
400 NOT_SUPPORTED Sorry, it seems that this is not supported at the moment
400 INVALID_PAYMENT_METHOD Payment method is invalid
400 IN_PROCESSING Transaction is processing
400 ALREADY_COMPLETED Transaction is already completed
400 ALREADY_CANCELLED Transaction is already cancelled
400 ALREADY_ACCEPTED Transaction is already accepted
400 ALREADY_REJECTED Transaction is already rejected
401 UNAUTHORIZED No valid Secret Key provided.
403 FORBIDDEN The parameters were valid but the request failed.
404 NOT_FOUND The requested resource doesn't exist.
409 CONFLICT The request conflicts with another request (perhaps due to using the same idempotent key).
422 UNPROCESSABLE_CONTENT The request cannot be processed due to semantic errors or invalid data
500 INTERNAL_SERVER_ERROR Something went wrong on Conductor's end

API Workflows

Primitive Flow

The primitive flow describes a complex implementation that allows partners to customise and initiate transactions to Moment’s conductor API with more API calls.

Flow 1: Account_Enquiry + Create_Transactions

This primitive flow entails the initiation of an account enquiry and a create transaction with the complete.

Primitive Flow 1

Flow 2: Account_Enquiry + Create_Transactions + Complete_Transaction or Cancel_Transaction

Primitive Flow 2

Composite Flow

The composite flow describes a simpler implementation that allows partners to initiate transactions to the Moment’s conductor partner APIs with fewer API calls.

Flow 1: Create_Transactions with complete = true, payment_method and amount set

Composite Flow 1

Flow 2: Create_Transactions + Complete_Transaction or Cancel_Transaction

Composite Flow 2

Catalog Order Transaction Flow

The catalog and order transaction flow describes an implementation that allows partners to get product catalog information for a biller, upgrade or downgrade by creating an order against the product and submitting payment to Moment’s conductor APIs.

Flow 1: Fetch_Catalog + Create_Order + Create_Transaction

Catalog Flow 1

Dev Support

Moment supports partner development through enhanced communication and collaboration over Slack Connect.

API Operations

Healthcheck

Healthcheck APIs

Request Healthcheck

Conductor API provides a /healthcheck endpoint to check the operating status of the APIs. It is a ping for the API entry points to ensure the entry points are accessible. This is the first thing you can do if something goes wrong.

Authorizations:
Authorization

Responses

Request samples

curl --request POST \
--url 'https://api.momentco.net/healthcheck'

Response samples

Content type
application/json
{
  • "status": {
    }
}

Accounts

Accounts APIs

Request account details

Request the account details for a customer including the amount due and the associated bills.

Authorizations:
Authorization
Request Body schema: application/json

Post the necessary fields for the API to request the bills.

biller_code
required
string

Unique Biller Code for the Biller

identifier
required
object (CustomerIdentifier)

For za_dstv, accepted input is:
- search identifier (which can be customer number, smart card number or South African national ID) as a string (for example: "1234567890")

For ng_dstv, accepted inputs are:
- customer number as an object (for example: { "customer_number": "1234567890" })
- smart card number as an object (for example: { "smart_card_number": "987654321237" })

reference
string

The product reference for the biller

For example, in case of za_dstv biller, it can be one of the following:
- SUBS (DSTV Subscription) or
- TVOD (BoxOffice)

Responses

Request samples

Content type
application/json
{
  • "biller_code": "za_dstv",
  • "identifier": "8604275423086",
  • "reference": "SUBS"
}

Response samples

Content type
application/json
{
  • "external_id": "8604275423086",
  • "customer": {
    },
  • "biller": {
    },
  • "amount_due": {
    },
  • "products": [
    ],
  • "bills": [
    ]
}

Transactions

Transactions APIs

Get Transaction

The API Allows to fetch the transactional details

Authorizations:
Authorization

Responses

Request samples

curl --request GET \
--url 'https://api.momentco.net/conductor/v1/transactions/e37d07ed-1899-418a-868c-1a1c72645223' \
--header 'Content-Type: application/json ' \
--header 'Authorization': 'Bearer sk_RhKeWM4c1mB32CjwIdpfuqDJ'

Response samples

Content type
application/json
{
  • "status": {
    },
  • "data": {
    }
}

Create Transaction

Create a Transaction to validate and authorize for bill payments

Authorizations:
Authorization
header Parameters
Retailer-Id
required
any (Retailer-Id)

A unique identifier that represents the originating retailer of this transaction.

Note: List of valid retailer ids would be provided by Moment to the Partner.

Idempotency-Key
any (Idempotency-Key)

Unique request identifier for safely retrying requests without accidentally performing the same operation twice. Must be unique for every action.

Request Body schema: application/json

Post the necessary fields for the API to request the bills.

external_reference
required
string

Unique External Reference ID Provided by Partner

required
Array of objects (Items)
object (Money)

Amount Object with value and currency

complete
boolean
Default: false

Passed as true if we want to create and complete the transaction in one go.

payment_method
string
Enum: "CASH" "DEBIT_CARD" "CREDIT_CARD" "BANK_TRANSFER" "MOBILE_MONEY" "EWALLET"

Passed if we pass complete is true

Note: For other payment methods, please contact Moment.

meta_data
object

Partners can include extra metadata within this object.

Responses

Request samples

Content type
application/json
{
  • "external_reference": "fbdb3963-8848-4910-9959-42c67b7d6986",
  • "items": [
    ],
  • "complete": false,
  • "payment_method": "CASH",
  • "meta_data": {
    }
}

Response samples

Content type
application/json
{
  • "status": {
    },
  • "data": {
    }
}

Complete Transaction

Complete a Transaction to process the bill payment

Authorizations:
Authorization
header Parameters
Idempotency-Key
any (Idempotency-Key)

Unique request identifier for safely retrying requests without accidentally performing the same operation twice. Must be unique for every action.

Request Body schema: application/json

Post the payment method type through which payment was collected

payment_method
string
Enum: "CASH" "DEBIT_CARD" "CREDIT_CARD" "BANK_TRANSFER" "MOBILE_MONEY" "EWALLET"

Note: For other payment methods, please contact Moment.

meta_data
object

Partners can include extra metadata within this object.

Responses

Request samples

Content type
application/json
{
  • "payment_method": "CASH",
  • "meta_data": {
    }
}

Response samples

Content type
application/json
{
  • "status": {
    },
  • "data": {
    }
}

Cancel Transaction

Cancel a Transaction to cancel the bill payment process

Authorizations:
Authorization
header Parameters
Idempotency-Key
any (Idempotency-Key)

Unique request identifier for safely retrying requests without accidentally performing the same operation twice. Must be unique for every action.

Request Body schema: application/json

Post the reason due to which payment couldn't be collected

reason
string
meta_data
object

Partners can include extra metadata within this object.

Responses

Request samples

Content type
application/json
{
  • "reason": "Credit card declined payment.",
  • "meta_data": {
    }
}

Response samples

Content type
application/json
{
  • "status": {
    },
  • "data": {
    }
}

Partners

Partner APIs

Create Transaction

Create a Transaction to pay for a given biller and optionally complete the transaction

Authorizations:
Authorization
header Parameters
Retailer-Id
required
any (Retailer-Id)

A unique identifier that represents the originating retailer of this transaction.

Note: List of valid retailer ids would be provided by Moment to the Partner.

Idempotency-Key
any (Idempotency-Key)

Unique request identifier for safely retrying requests without accidentally performing the same operation twice. Must be unique for every action.

Request Body schema: application/json
external_reference
required
string

Must be a unique identifier to identify this transaction

biller_code
required
string
reference
string

The product reference for the biller

For example, in case of za_dstv biller, it can be one of the following:
- SUBS (DSTV Subscription) or
- TVOD (BoxOffice)

required
object (Money)

Amount Object with value and currency

identifier
required
object (CustomerIdentifier)

For za_dstv, accepted input is:
- search identifier (which can be customer number, smart card number or South African national ID) as a string (for example: "1234567890")

For ng_dstv, accepted inputs are:
- customer number as an object (for example: { "customer_number": "1234567890" })
- smart card number as an object (for example: { "smart_card_number": "987654321237" })

complete
boolean
Default: false

Passed as true if we want to create and complete the transaction in one go.

payment_method
string
Enum: "CASH" "DEBIT_CARD" "CREDIT_CARD" "BANK_TRANSFER" "MOBILE_MONEY" "EWALLET"

Passed if we pass complete is true

Note: For other payment methods, please contact Moment.

meta_data
object

Partners can include extra metadata within this object.

Responses

Request samples

Content type
application/json
{
  • "external_reference": "5e4b65ba-1e15-44c8-b11f-d0beda039246",
  • "biller_code": "za_dstv",
  • "identifier": "8604275423086",
  • "payment_method": "CASH",
  • "reference": "SUBS",
  • "amount": {
    },
  • "complete": false,
  • "meta_data": {
    }
}

Response samples

Content type
application/json
{
  • "status": {
    },
  • "data": {
    }
}

Get Transaction

Authorizations:
Authorization

Responses

Request samples

curl --request GET \
--url 'https://api.momentco.net/conductor/v1/partners/transactions/5e4b65ba-1e15-44c8-b11f-d0beda039246' \
--header 'Content-Type: application/json ' \
--header 'Authorization': 'Bearer sk_RhKeWM4c1mB32CjwIdpfuqDJ'

Response samples

Content type
application/json
{
  • "status": {
    },
  • "data": {
    }
}

Complete Transaction

Complete a Transaction to process the bill payment

Authorizations:
Authorization
header Parameters
Idempotency-Key
any (Idempotency-Key)

Unique request identifier for safely retrying requests without accidentally performing the same operation twice. Must be unique for every action.

Request Body schema: application/json

Post the payment method type through which payment was collected

payment_method
string
Enum: "CASH" "DEBIT_CARD" "CREDIT_CARD" "BANK_TRANSFER" "MOBILE_MONEY" "EWALLET"

Note: For other payment methods, please contact Moment.

meta_data
object

Partners can include extra metadata within this object.

Responses

Request samples

Content type
application/json
{
  • "payment_method": "CASH",
  • "meta_data": {
    }
}

Response samples

Content type
application/json
{
  • "status": {
    },
  • "data": {
    }
}

Cancel Transaction

Cancel a Transaction to cancel the bill payment process

Authorizations:
Authorization
header Parameters
Idempotency-Key
any (Idempotency-Key)

Unique request identifier for safely retrying requests without accidentally performing the same operation twice. Must be unique for every action.

Request Body schema: application/json

Post the reason due to which payment couldn't be collected

reason
string
meta_data
object

Partners can include extra metadata within this object.

Responses

Request samples

Content type
application/json
{
  • "reason": "Credit card declined payment.",
  • "meta_data": {
    }
}

Response samples

Content type
application/json
{
  • "status": {
    },
  • "data": {
    }
}

Catalog & Orders

Catalog & Orders APIs

Get Catalogs

The API allows to fetch the Moment Catalog based on a variety of filter criteria.

Authorizations:
Authorization
query Parameters
category_code
string
Example: category_code=ng_entertainment_cabletv

This is the category of which the subcategories and products are requested.

depth
string
Example: depth=1

Depth determines the number of levels it should get the subcategories and products at. Default is 1.

Responses

Response samples

Content type
application/json
{
  • "status": {
    },
  • "data": {
    }
}

Create Order

The API allows to create an order containing one or more products.

Authorizations:
Authorization
Request Body schema: application/json

Post the necessary fields for the API to create the order.

biller_code
required
string

Biller code of the Biller of which products are being paid for.

identifier
required
object (CustomerIdentifier)

For za_dstv, accepted input is:
- search identifier (which can be customer number, smart card number or South African national ID) as a string (for example: "1234567890")

For ng_dstv, accepted inputs are:
- customer number as an object (for example: { "customer_number": "1234567890" })
- smart card number as an object (for example: { "smart_card_number": "987654321237" })

required
Array of objects (OrderProductItem)

Responses

Request samples

Content type
application/json
{
  • "biller_code": "ng_dstv",
  • "identifier": {
    },
  • "products": [
    ]
}

Response samples

Content type
application/json
{
  • "status": {
    },
  • "data": {
    }
}

Get Order

The API allows to fetch the details of an order.

Authorizations:
Authorization

Responses

Response samples

Content type
application/json
{
  • "status": {
    },
  • "data": {
    }
}