{
  "openapi": "3.1.0",
  "info": {
    "title": "Whish Direct Credit",
    "version": "1.0.0",
    "description": "Credit funds directly into a customer's Whish wallet (wallet-to-wallet), settled instantly. sendw2w requires IP whitelisting."
  },
  "servers": [
    {
      "url": "https://partner.api.sbx.whish.money/itel-service/api",
      "description": "Sandbox"
    },
    {
      "url": "https://api.whish.money/itel-service/api",
      "description": "Production"
    }
  ],
  "components": {
    "securitySchemes": {
      "channelAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "channel"
      },
      "secretAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "secret"
      },
      "websiteUrlAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "websiteUrl"
      }
    }
  },
  "security": [
    {
      "channelAuth": [],
      "secretAuth": [],
      "websiteUrlAuth": []
    }
  ],
  "paths": {
    "/payment/account/balance": {
      "get": {
        "summary": "Get account balance",
        "responses": {
          "200": {
            "description": "Standard response envelope.",
            "content": {
              "application/json": {
                "example": {
                  "status": true,
                  "code": null,
                  "dialog": null,
                  "actions": null,
                  "extra": null,
                  "data": {
                    "balance": 940977.0
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User-Agent",
            "in": "header",
            "required": true,
            "description": "Identifies your application. Format: `AppName/version (website; contact-email)`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/payment/sendw2w": {
      "post": {
        "summary": "Send a whish-to-whish credit",
        "description": "The `externalId` must be UNIQUE for every new transaction. It is a String, and it is the idempotency key: re-sending a value that was already used does NOT create a second transaction, it replays the original result. Only reuse the same `externalId` when you are deliberately retrying the very same transaction (for example after a timeout), and mint a new one for every genuinely new transaction. Requires IP whitelisting of your egress IPs.",
        "responses": {
          "200": {
            "description": "Standard response envelope.",
            "content": {
              "application/json": {
                "example": {
                  "status": true,
                  "code": null,
                  "dialog": null,
                  "actions": null,
                  "extra": null,
                  "data": null
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User-Agent",
            "in": "header",
            "required": true,
            "description": "Identifies your application. Format: `AppName/version (website; contact-email)`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "externalId": "1234",
                "note": "Payout for order #A-1234",
                "countryCode": "961",
                "msisdn": "+9617XXXXXXX",
                "amount": 50.0,
                "currency": "USD"
              }
            }
          }
        }
      }
    },
    "/payment/sendw2w/status": {
      "get": {
        "summary": "Get credit status",
        "responses": {
          "200": {
            "description": "Standard response envelope.",
            "content": {
              "application/json": {
                "example": {
                  "status": true,
                  "code": null,
                  "dialog": null,
                  "actions": null,
                  "extra": null,
                  "retrieved": true,
                  "data": null
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "User-Agent",
            "in": "header",
            "required": true,
            "description": "Identifies your application. Format: `AppName/version (website; contact-email)`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "externalId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    }
  }
}