openapi: 3.0.1 info: title: DCB OneTime description: > The DCB (Direct Carrier Billing) API enables consumers to change their balance allowing both debit (one time debit and recurring debit) operations. Every bucket will measure balance in different units, it can be monetary or non-monetary (e.g.: number of sms that are available, number of GB of data available). version: 1.0.0 servers: - url: https://api.ooredoo.com description: Ooredoo API gateway paths: /tmf-api/oauth/v4/generateToken: post: summary: Generate Access Token description: Token generation endpoint (client_id, client_secret, scope in headers; msisdn, charge, grant_type in body) parameters: - name: client_id in: header required: true description: Client ID of onboarded client. schema: type: string default: 67Q4itU3ivApTHRB4dJKFh4R5UAdG5RAsMeEq2NppNgd6LBH - name: client_secret in: header required: true description: Client secret of onboarded client. schema: type: string default: yp1CUQyGwEMNruGXtnhIbpTOuK6BGlxAFmiGlG2FQea3cHgaVqRw7rybKnWAUeKB - name: scope in: header required: true description: OAuth scope schema: type: string default: urn:mdv:prepaybalancemanagement:createadjustbalance:onetimedebit - name: transactionId in: header required: true description: Transaction ID schema: type: string default: zxq9pgoJRXVg5snSocpZ9iT9rxpp requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object properties: msisdn: type: string description: Subscriber MSISDN default: 9612198 charge: type: number description: Charge amount for the transaction default: 1 grant_type: type: string description: OAuth grant type default: client_credentials required: - msisdn - charge - grant_type responses: '200': description: Successful token response content: application/json: schema: type: object properties: access_token: type: string token_type: type: string expires_in: type: integer consented_on: type: string created_At: type: string expired_At: type: string '401': description: Unauthorized content: application/json;charset=utf-8: schema: $ref: "#/components/schemas/Error" /tmf-api/prepayBalanceManagement/v4/adjustBalance: post: summary: Create an AdjustBalance description: This operation creates an AdjustBalance entity. operationId: createAdjustBalance parameters: - name: transactionId in: header description: Unique identifier of the request message. Must be alphanumeric, 20–30 characters, no special symbols. required: true schema: maxLength: 30 minLength: 20 pattern: ^[A-Za-z0-9]+$ type: string default: zxq9pgoJRXVg5snSocpZ9iT9rxpp - name: countryCode in: header description: ISO country code (e.g., MDV). required: true schema: maxLength: 3 minLength: 2 pattern: ^[A-Z]{2,3}$ type: string default: MDV requestBody: description: The AdjustBalance to be created content: application/json;charset=utf-8: schema: $ref: "#/components/schemas/AdjustBalance_CreateOne" required: true responses: "201": description: Created headers: transactionId: description: Transaction Id schema: type: string content: application/json;charset=utf-8: schema: $ref: "#/components/schemas/AdjustBalance" "400": description: Bad Request content: application/json;charset=utf-8: schema: $ref: "#/components/schemas/Error" "401": description: Unauthorized content: application/json;charset=utf-8: schema: $ref: "#/components/schemas/Error" "403": description: Forbidden content: application/json;charset=utf-8: schema: $ref: "#/components/schemas/Error" "405": description: Method Not allowed content: application/json;charset=utf-8: schema: $ref: "#/components/schemas/Error" "409": description: Conflict content: application/json;charset=utf-8: schema: $ref: "#/components/schemas/Error" "422": description: Business Rule Exception content: application/json;charset=utf-8: schema: $ref: "#/components/schemas/Error" "500": description: Internal Server Error content: application/json;charset=utf-8: schema: $ref: "#/components/schemas/Error" x-codegen-request-body-name: adjustBalance security: - BearerAuth: [] components: schemas: ActionStatusType: type: string description: Valid values for the Action Status Type default: created enum: - created - failed - cancelled - completed AdjustBalance: type: object properties: id: type: string description: Unique Identifier for the resource href: type: string description: A reference to the resource status: $ref: "#/components/schemas/ActionStatusType" amount: $ref: "#/components/schemas/Quantity" bucket: $ref: "#/components/schemas/BucketRef" usageType: $ref: "#/components/schemas/UsageType" description: The AdjustBalance resource allows adjustments to be made to the original BalanceTopup. AdjustBalance_CreateOne: required: - amount - bucket - usageType type: object properties: channel: type: string description: valid values for the channel name default: karti OTP: pattern: ^[0-9a-zA-Z]{6}$ type: string description: valid values for OTP default: 123456 description: type: string description: Description of the recharge operation value default: Charges for Subscription amount: $ref: "#/components/schemas/Quantity" bucket: $ref: "#/components/schemas/BucketRef" usageType: $ref: "#/components/schemas/UsageType" partyAccount: $ref: "#/components/schemas/PartyAccountRef" product: type: array items: $ref: "#/components/schemas/ProductRef" description: > The AdjustBalance resource allows adjustments to be made to the original BalanceTopup. BucketRef: required: - id - name type: object properties: id: type: string description: unique identifier default: 1343241 name: type: string description: Name of the related entity. default: New Subscription description: link to the resource that holds bucket information PartyAccountRef: type: object properties: id: type: string description: Unique identifier of the party account default: Meena name: type: string description: Name of the party account default: TV partyDetails: type: string description: Name of the party account default: TV subscription description: PartyAccount reference. A party account is an arrangement that a party has with an enterprise that provides products to the party. ProductRef: required: - id type: object properties: id: type: string description: unique identifier default: SPORTS_WORLD_MONTHLY name: type: string description: unique identifier default: SPORTS_WORLD_MONTHLY "@type": type: string description: unique identifier default: SPORTS_WORLD_MONTHLY Quantity: required: - amount - units type: object properties: amount: type: number description: Numeric value in a given unit. format: float default: 1 units: type: string description: units of currency. default: MVR enum: - DZD - OMR - TND - MVR - FILS - ILS - QAR - IQD description: Indicate the amount on the bucket UsageType: type: string description: Denotes the usage of amount default: monetary enum: - monetary - voice - data - sms - other Error: required: - code - reason type: object properties: code: type: string description: Application relevant detail, defined in the API or a common list. reason: type: string description: Explanation of the reason for the error which can be shown to a client user. message: type: string description: More details and corrective actions related to the error which can be shown to a client user. status: type: string description: HTTP Error code extension referenceError: type: string description: URI of documentation describing the error. format: uri "@baseType": type: string description: When sub-classing, this defines the super-class. "@schemaLocation": type: string description: A URI to a JSON-Schema file that defines additional attributes and relationships format: uri "@type": type: string description: When sub-classing, this defines the sub-class entity name. description: Used when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx) securitySchemes: BearerAuth: type: http scheme: bearer bearerFormat: JWT x-original-swagger-version: "2.0"