{
  "openapi": "3.0.0",
  "info": {
    "version": "3.0.0-rc.116",
    "title": "Rebilly MGS API",
    "contact": {
      "name": "Rebilly API Support",
      "url": "https://www.rebilly.com/contact/",
      "email": "integrations@rebilly.com"
    },
    "license": {
      "name": "Rebilly",
      "url": "https://www.rebilly.com/api/license/"
    },
    "termsOfService": "https://www.rebilly.com/terms/",
    "description": "---\nexcludeFromSearch: true\n---\n## Introduction\n\nThe Rebilly API is built on HTTP.\nThis API is RESTful.\nIt has predictable resource URLs.\nIt returns HTTP response codes to indicate errors.\nIt also accepts and returns JSON in the HTTP body.\nYou can use your favorite HTTP/REST library for your programming language to use the Rebilly API.\n\nThis particular document is for MGS.\nNote that additional members may be added to the response without notice, and the integration should be stable enough to ignore those without breaking functionality.\n\n# Authentication\n\nWhen you sign up for an account, you are given your first API key.\nTo do so, follow this link: [rebilly.com](https://www.rebilly.com/) and visit the signup or join link.\n\nYou can generate additional API keys, and delete API keys.\nYou may need to rotate your keys in the future.\n\nYou authenticate to the Rebilly API by providing your secret key in the request header.\n\nRebilly offers multiple forms of authentication: secret key, JSON Web Tokens, and publishable key.\nRebilly recommends private key authentication for this integration.\n\n- secret key: authenticates each request by searching for the presence of an HTTP header: `REB-APIKEY`.\n\nNever share your secret keys.\nKeep them guarded and secure.\n\n# Environments\n\nRebilly has a sandbox and a live api.\nThe primary differences are:\n\n- the same API Key will not work on both sandbox and live.\n- the sandbox is intended for testing.\n- the subdomain of the api endpoing is: `api-sandbox` in the sandbox, and `api` in the live environment.\n\n# Money-in flow diagram\n\n{% img src=\"/images/mgs/money-in-flow.png\" alt=\"Money-in flow diagram\" withLightbox=true /%}\n\n# Money-out flow diagram\n\n{% img src=\"/images/mgs/money-out-flow.png\" alt=\"Money-out flow diagram\" withLightbox=true /%}\n\n# Miscellaneous methods mapping\n\n{% partial file=\"/mgs-api-definitions/openapi/descriptions/_misc-methods-mapping.md\" /%}\n\n## Dynamic miscellaneous methods mapping - CashierMiscMethod\n\n{% partial file=\"/mgs-api-definitions/openapi/descriptions/_dynamic-misc-methods-mapping.md\" /%}\n\n# Supported payment methods\n\n{% partial file=\"/mgs-api-definitions/openapi/descriptions/_supported-payment-methods.md\" /%}\n\n# Test cards\n\n{% partial file=\"/mgs-api-definitions/openapi/descriptions/_test-cards.md\" /%}\n\n## Payouts test cards\n\n{% partial file=\"/mgs-api-definitions/openapi/descriptions/_payout-test-cards.md\" /%}\n\n# Key changes\n\n{% partial file=\"/mgs-api-definitions/openapi/descriptions/_changelog.md\" /%}\n\n# Errors\n\nRebilly follows the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs.\nAs with other Rebilly API responses, your client must be prepared to gracefully handle additional members of the response.\n\n## Unauthorized\n\n{% partial file=\"/mgs-api-definitions/openapi/descriptions/_unauthorized.md\" /%}\n\n## AccessForbidden\n\n{% partial file=\"/mgs-api-definitions/openapi/descriptions/_access-forbidden.md\" /%}\n\n## ResourceNotFound\n\n{% partial file=\"/mgs-api-definitions/openapi/descriptions/_resource-not-found.md\" /%}\n\n## Conflict\n\n{% partial file=\"/mgs-api-definitions/openapi/descriptions/_conflict.md\" /%}\n\n## ValidationError\n\n{% partial file=\"/mgs-api-definitions/openapi/descriptions/_validation-error.md\" /%}\n",
    "x-metadata": {
      "description": "MGS API documentation",
      "redocly_category": "API Reference"
    }
  },
  "servers": [
    {
      "url": "https://api.rebilly.com/mgs",
      "description": "Live Server"
    },
    {
      "url": "https://api-sandbox.rebilly.com/mgs",
      "description": "Sandbox Server"
    }
  ],
  "tags": [
    {
      "name": "Cashier",
      "description": "Cashier operations"
    },
    {
      "name": "Orders",
      "description": "---\nexcludeFromSearch: true\n---\nPayment has a lifecycle in Rebilly, which is represented by its `status`.\n\nStarting as `pending` if the payment is to occur in the future, or `sending` while the payment is being processed and sent to the gateway or processor.\n\nThen, it may be one of several statuses:\n\n- `never-sent`: if the payment is, say, aborted during process in some way.\n  For example, players can cancel out of a 3DS process.\n- `timeout` or `conn-error`: if the payment is, say, aborted during network errors on send to gateway.\n- `waiting-capture` or `waiting-refund`: if the payment is, say, waiting on the gateway to do some processing, typically, post-authorization processing like delayed capture.\n- `waiting-approval`: if the payment is waiting for the player to do some interaction, such as interacting with 3DS, China UnionPay, OchaPay, or any other method that requires interaction.\n  Most interaction happens expediently, within minutes, but some may require a player to visit a 3rd party physical venue, and may take hours or days to complete.\n- `offsite`: if the user is redirected to the gateway to approve their payment.\n- `completed`: if the payment is sent to the gateway and completed successfully.\n  This does **NOT** mean that the payment is approved.\n  To check approval, see the payment `Result` field.\n"
    },
    {
      "name": "Payouts",
      "description": "Payout operations"
    }
  ],
  "security": [
    {
      "ApiKey": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "description": "When you sign up for an account, you are given your first API key.\n\nTo do so please follow this link: https://www.rebilly.com/ and visit the\nsignup or join link.\n\nAlso you can generate additional API keys, and delete API keys (as you may\n\nneed to rotate your keys in the future).",
        "name": "REB-APIKEY",
        "type": "apiKey",
        "in": "header"
      }
    },
    "parameters": {
      "collectionFilter": {
        "name": "filter",
        "in": "query",
        "description": "Criteria for filtering collection items.\nThis field requires a special format.\nUse `,` to specify multiple allowed values.\nUse `;` to specify multiple fields.\n\nFor more information, see [Search filters](https://www.rebilly.com/docs/dev-docs/search-filters).",
        "schema": {
          "type": "string"
        }
      },
      "collectionSort": {
        "name": "sort",
        "in": "query",
        "description": "Sorts and orders the collection of items.\nTo sort in descending order, prefix the field with `-`.\nMultiple fields can be sorted by separating each with `,`.",
        "style": "form",
        "explode": false,
        "schema": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "organizationId": {
        "name": "Organization-Id",
        "in": "header",
        "description": "Unique organization identifier.\nThe gaming server ID maps to an organization in Rebilly.\nIf this value is not set, the default user gaming server is used.",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "resourceId": {
        "name": "OrderID",
        "in": "path",
        "description": "ID of the resource.",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "Order": {
        "type": "object",
        "required": [
          "OrderID",
          "PaymentMethod",
          "CasinoID",
          "PlayerID",
          "OrderCurrency",
          "OrderAmount",
          "Email",
          "IpAddress",
          "FirstName",
          "LastName",
          "Country",
          "NotificationURL"
        ],
        "discriminator": {
          "propertyName": "PaymentMethod",
          "mapping": {
            "alternative": "#/components/schemas/alternative",
            "payment-card": "#/components/schemas/payment-card"
          }
        },
        "properties": {
          "PaymentMethod": {
            "$ref": "#/components/schemas/PaymentMethod"
          },
          "TransactionID": {
            "description": "ID of the transaction.\nThis value is unique for the merchant in Rebilly.\nRebilly attempts to use the `OrderID`,\nbut if the value is not unique, a variation is generated.",
            "readOnly": true,
            "example": "123_4567899",
            "allOf": [
              {
                "$ref": "#/components/schemas/ResourceId"
              }
            ]
          },
          "OrderID": {
            "description": "ID of the payment.\nThis value must be unique for the merchant within a 24-hour period,\nto prevent duplicate requests.",
            "example": "123_4567899",
            "allOf": [
              {
                "$ref": "#/components/schemas/ResourceId"
              }
            ]
          },
          "CasinoID": {
            "description": "ID of the casino.\nThis value maps to a website ID in Rebilly.",
            "example": "123",
            "allOf": [
              {
                "$ref": "#/components/schemas/ResourceId"
              }
            ]
          },
          "GSID": {
            "description": "ID of the gaming server.\nThis value maps to an organization ID in Rebilly.",
            "example": "22",
            "allOf": [
              {
                "$ref": "#/components/schemas/ResourceId"
              }
            ],
            "readOnly": true
          },
          "PlayerID": {
            "description": "ID of the player.\nThis value maps to a `customer` in Rebilly.\nIt is composed of two parts concatenated by an underscore.\nThe first part is the registration casino ID, and the second part is the user ID.",
            "example": "123_111222333",
            "allOf": [
              {
                "$ref": "#/components/schemas/ResourceId"
              }
            ]
          },
          "LimitCurrency": {
            "description": "Three character [ISO 4217 alpha-3 code](https://en.wikipedia.org/wiki/ISO_4217).\nThis value must be configured in the gateway account.",
            "type": "string",
            "example": "GBP",
            "format": "ISO-4217-alpha-3"
          },
          "LimitAmount": {
            "description": "Limit amount with no currency symbol.\n\nIf no purchase limit is in place,\nthis value is `null`, `0`, `0.00`, or not supplied with the request.\n\nIf a purchase limit is in place, this value designates the available purchase limit remaining.\nFor example, if the player has set a daily limit of $200,\nand has already deposited $150 during that day, the limit remaining is $50.\nRebilly prevents any purchase adjustment or bump from causing the limit to be breached.",
            "type": "string",
            "example": "55.00"
          },
          "LimitResetTime": {
            "description": "Date and time when the purchase limit resets.\nIf a message must be displayed to the player,\nthis value may be transformed and used by the user interface.",
            "type": "string",
            "example": "2019-02-12T22:45:00+00:00",
            "format": "date-time"
          },
          "OrderCurrency": {
            "description": "Three character [ISO 4217 alpha-3 code](https://en.wikipedia.org/wiki/ISO_4217).\nThis value must be configured in the gateway account.",
            "type": "string",
            "example": "GBP",
            "format": "ISO-4217-alpha-3"
          },
          "OrderAmount": {
            "description": "Payment amount with no currency symbol.\nIt is important to check the `PurchaseAmount`,\nwhich may be different from the `OrderAmount` if the player changed the order mid-process,\nwhich could be due to an upsell or bump scenario.",
            "type": "string",
            "example": "45.00"
          },
          "PurchaseCurrency": {
            "description": "Three character [ISO 4217 alpha-3 code](https://en.wikipedia.org/wiki/ISO_4217).\nThis value must be configured in the gateway account.\nThis value always matches the `OrderCurrency`.",
            "type": "string",
            "readOnly": true,
            "example": "GBP",
            "format": "ISO-4217-alpha-3"
          },
          "PurchaseAmount": {
            "description": "Amount purchased.\nIf a bump occurs, this value is larger than the\n`OrderAmount`.\nUse this value to credit the player.\nPlease pay careful attention to this field.",
            "type": "string",
            "readOnly": true,
            "example": "55.00"
          },
          "BillingCurrency": {
            "description": "Three character [ISO 4217 alpha-3 code](https://en.wikipedia.org/wiki/ISO_4217).\nWhen dynamic currency conversion occurs, this is the currency billed.",
            "type": "string",
            "readOnly": true,
            "example": "GBP",
            "format": "ISO-4217-alpha-3"
          },
          "BillingAmount": {
            "description": "Amount billed.\nWhen dynamic currency conversion occurs, this is the amount of the currency billed.",
            "type": "string",
            "readOnly": true,
            "example": "45.00"
          },
          "BillingDescriptor": {
            "description": "Billing descriptor that is displayed on the cardholder's billing statement.",
            "type": "string",
            "readOnly": true,
            "example": "My descriptor"
          },
          "DOB": {
            "description": "Player's date of birth in [ISO 8601 full-date format (yyyy-mm-dd)](http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14).",
            "type": "string",
            "format": "date"
          },
          "IpAddress": {
            "description": "IPv4 address in dotted decimal format.",
            "type": "string",
            "format": "ipv4",
            "example": "127.0.0.1"
          },
          "Email": {
            "description": "Player's email address.\nThe email must match an email regex, and also be at a domain with a valid MX record.\nRebilly does not send any emails.",
            "type": "string",
            "format": "email",
            "example": "user@example.com"
          },
          "FirstName": {
            "description": "Player's first name.",
            "type": "string",
            "minLength": 3,
            "maxLength": 45,
            "example": "Arnold"
          },
          "LastName": {
            "description": "Player's last name.",
            "type": "string",
            "minLength": 3,
            "maxLength": 45,
            "example": "Schwartzenegger"
          },
          "Address": {
            "description": "Player's street address.",
            "type": "string",
            "maxLength": 60,
            "example": "31 Guild Street"
          },
          "Address2": {
            "description": "Player's second line of street address.",
            "type": "string",
            "maxLength": 60,
            "example": "Apartment 2"
          },
          "City": {
            "description": "Player's city.",
            "type": "string",
            "maxLength": 45,
            "example": "London"
          },
          "Region": {
            "description": "Player's state, province, territory, parish, or region.",
            "type": "string",
            "maxLength": 45,
            "example": "Westminster"
          },
          "Country": {
            "description": "Player's country in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.\nTwo characters max.",
            "type": "string",
            "maxLength": 2,
            "example": "GB",
            "format": "ISO-3166-1-alpha-2"
          },
          "PostalCode": {
            "description": "Player's postal code, also known as the post code or zip code.",
            "type": "string",
            "maxLength": 10,
            "example": "E8 6XD"
          },
          "PhoneNumber": {
            "description": "Player's telephone number, which may be either a landline or mobile.",
            "type": "string",
            "maxLength": 20,
            "example": "077 8826 0192"
          },
          "NotificationURL": {
            "description": "For offsite payments that require third-party verification,\nthis URL is called by the system when the payment returns from the offsite process.\n\nIf the transaction times out or an other exceptional type of transaction occurs,\nthis URL is used to update when the `result` changes from `unknown` to another value.",
            "type": "string",
            "format": "url"
          },
          "RedirectURL": {
            "description": "For offsite payment due to third party verification,\nthis URL is used to redirect the player upon the completion of the interaction.",
            "type": "string",
            "format": "url"
          },
          "UserAgent": {
            "description": "Player's user-agent header from the browser request.",
            "type": "string",
            "maxLength": 255,
            "example": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.170 Safari/537.36"
          },
          "Language": {
            "description": "Player's designated language in [ISO-639-1 alpha-2](https://en.wikipedia.org/wiki/ISO_639-1) format and optional [ISO-3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code.\nFor example, `en-AU` for Australian English.",
            "type": "string",
            "maxLength": 5,
            "example": "en-US",
            "format": "ISO-639-1-alpha-2"
          },
          "ExtraData": {
            "type": "object",
            "description": "Extra data list as a map `{\"field name\": \"custom value\", ...}`.\n\nThe format must follow the saved format.\nRecommended fields are `BannerTagId`, `RegistrationDate`, and `DeviceFingerprint`.\nIf a global or master user ID is available, that would be appropriate too.",
            "example": {
              "BannerTagId": "123|456|789|098|765|543|210",
              "RegistrationDate": "2017-03-23",
              "DeviceFingerprint": "23932819301914985",
              "CPF": "123456789"
            }
          },
          "Status": {
            "description": "Status of the payout.\nSome status values require special handling, such as:\n\n- `timeout` (or `conn-error`): Rebilly polls the gateway to determine\nif the payout is processed.\nThe payout should be held open until a determination is made.\nRebilly sends a notification to the `NotificationURL` upon resolution of the `timeout` and `conn-error` states.\n- `waiting-gateway`: Rebilly polls final status and sends a notification to `NotificationURL` when the payout is completed.\n- `offsite`: The user has already been redirected to the `approvalUrl` and is awaiting notification from the third party gateway.",
            "type": "string",
            "readOnly": true,
            "enum": [
              "pending",
              "sending",
              "timeout",
              "conn-error",
              "never-sent",
              "waiting-capture",
              "waiting-gateway",
              "waiting-refund",
              "waiting-approval",
              "offsite",
              "completed",
              "refunded",
              "voided",
              "disputed",
              "partially-refunded"
            ],
            "example": "completed"
          },
          "Result": {
            "description": "Result of the payment.\nA result of `unknown` means the payment should be held open or pending for future changes.\nThis may happen because of a timeout or because interaction is necessary for further processing.\nIf interaction is necessary, there is a status of `waiting-approval`,\nor if the user has already been redirected to the third party for approval, it would be `offsite`.",
            "type": "string",
            "readOnly": true,
            "enum": [
              "approved",
              "declined",
              "canceled",
              "abandoned",
              "unknown"
            ]
          },
          "GatewayAccountID": {
            "description": "Merchant account used for the payment.",
            "type": "string",
            "readOnly": true,
            "example": "101_WorldPay_GBP_X"
          },
          "Acquirer": {
            "description": "Acquirer used for the payment.",
            "type": "string",
            "readOnly": true,
            "example": "Natwest"
          },
          "ResponseCode": {
            "description": "Code that maps to a message.\nThe code is a string number between 0 and 1000.\nSee Rebilly response codes.",
            "type": "string",
            "readOnly": true,
            "example": "00"
          },
          "ResponseMessage": {
            "description": "Message mapped from the code.",
            "type": "string",
            "readOnly": true,
            "example": "Successful approval"
          },
          "ResponseCodeGateway": {
            "description": "Code from the downstream gateway.",
            "type": "string",
            "readOnly": true,
            "example": "00"
          },
          "ResponseMessageGateway": {
            "description": "Message mapped from the code from the gateway.",
            "type": "string",
            "readOnly": true,
            "example": "Approved transaction"
          },
          "HumanMessage": {
            "description": "Message that is appropriate for presentation to a customer, translated into the language supplied in the request.",
            "type": "string",
            "readOnly": true,
            "example": "Your card has expired.  Please update your expiry dates and try again."
          },
          "GatewayTransactionID": {
            "description": "ID of the transaction from the gateway.",
            "type": "string",
            "readOnly": true,
            "example": "11111-22222-33333-44444"
          },
          "Display": {
            "description": "If interaction is required to complete the payment,\nthere is an `approvalUrl` field in the `_links` section of the API response.\n\nThis field determines if the `approvalUrl` should be displayed inline, as an iframe, or as a pop in a new window.\n\nIf the field has an empty string value,\nthere is no fixed requirement for the user experience.\n\nIf the value is `iframe`, it is recommended to display it as an `iframe`.\nIf the value is `pop`, it is required to display it as a pop in a new window.",
            "type": "string",
            "readOnly": true,
            "default": "iframe",
            "enum": [
              "pop",
              "iframe"
            ]
          },
          "CreatedTime": {
            "description": "Date and time when the payment is created.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ServerTimestamp"
              }
            ]
          },
          "UpdatedTime": {
            "description": "Date and time when the payment is updated.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ServerTimestamp"
              }
            ]
          },
          "_links": {
            "$ref": "#/components/schemas/Links"
          }
        }
      },
      "AlternativeMethod": {
        "type": "string",
        "description": "Name of the alternative method.\nThe value supplied here determines where the payment is routed.",
        "enum": [
          "Alipay",
          "Aircash",
          "Airpay",
          "AstroPay Card",
          "AstroPay-GO",
          "bank-transfer",
          "bank-transfer-2",
          "bank-transfer-3",
          "bank-transfer-4",
          "bank-transfer-5",
          "bank-transfer-6",
          "bank-transfer-7",
          "bank-transfer-8",
          "bank-transfer-9",
          "BankSEND",
          "bitcoin",
          "Bizum",
          "Blik",
          "Boleto",
          "Boleto-2",
          "Boleto-3",
          "cash-deposit",
          "CASHlib",
          "China UnionPay",
          "Cleo",
          "Commas-Checkout",
          "Conekta-spei",
          "Conekta-oxxo",
          "Dimoco-pay-smart",
          "Directa24Card",
          "echeck",
          "ecoPayz",
          "ecoVoucher",
          "ePay.bg",
          "ePayCard",
          "EPS",
          "Ethereum",
          "ezyEFT",
          "Flexepin",
          "Fyntra-Checkout",
          "Gpaysafe",
          "Giropay",
          "hosted-payment-card",
          "INOVAPAY-pin",
          "INOVAPAY-wallet",
          "instant-bank-transfer",
          "Instant Banking",
          "InstantPayments",
          "Interac-online",
          "Interac-eTransfer",
          "Interac",
          "invoice",
          "iWallet",
          "Jeton",
          "jpay",
          "KakaoPay",
          "Khelocard",
          "Litecoin",
          "loonie",
          "MiFinity-eWallet",
          "MercadoPago",
          "miscellaneous",
          "Misc_1",
          "Misc_2",
          "Misc_3",
          "Misc_4",
          "Misc_5",
          "Misc_6",
          "Misc_7",
          "Misc_8",
          "Misc_9",
          "Misc_10",
          "Misc_11",
          "Misc_12",
          "Misc_13",
          "Misc_14",
          "Misc_15",
          "Misc_16",
          "Misc_17",
          "Misc_18",
          "Misc_19",
          "Misc_20",
          "Misc_21",
          "Misc_22",
          "Misc_23",
          "Misc_24",
          "Misc_25",
          "Misc_26",
          "Misc_27",
          "Misc_28",
          "Misc_29",
          "Misc_30",
          "Misc_31",
          "Misc_32",
          "Misc_33",
          "Misc_34",
          "Misc_35",
          "Misc_36",
          "Misc_37",
          "Misc_38",
          "Misc_39",
          "Misc_40",
          "Misc_41",
          "Misc_42",
          "Misc_43",
          "Misc_44",
          "Misc_45",
          "Misc_46",
          "Misc_47",
          "Misc_48",
          "Misc_49",
          "Misc_50",
          "Misc_51",
          "Misc_52",
          "Misc_53",
          "Misc_54",
          "Misc_55",
          "Misc_56",
          "Misc_57",
          "Misc_58",
          "Misc_59",
          "Misc_60",
          "Misc_61",
          "Misc_62",
          "Misc_63",
          "Misc_64",
          "Misc_65",
          "Misc_66",
          "Misc_67",
          "Misc_68",
          "Misc_69",
          "Misc_70",
          "Misc_71",
          "Misc_72",
          "Misc_73",
          "Misc_74",
          "Misc_75",
          "Misc_76",
          "Misc_77",
          "Misc_78",
          "Misc_79",
          "Misc_80",
          "Misc_81",
          "Misc_82",
          "Misc_83",
          "Misc_84",
          "Misc_85",
          "Misc_86",
          "Misc_87",
          "Misc_88",
          "Misc_89",
          "Misc_90",
          "Misc_91",
          "Misc_92",
          "Misc_93",
          "Misc_94",
          "Misc_95",
          "Misc_96",
          "Misc_97",
          "Misc_98",
          "Misc_99",
          "Misc_100",
          "Misc_101",
          "Misc_102",
          "Misc_103",
          "Misc_104",
          "Misc_105",
          "Misc_106",
          "Misc_107",
          "Misc_108",
          "Misc_109",
          "Misc_110",
          "Misc_111",
          "Misc_112",
          "Misc_113",
          "Misc_114",
          "Misc_115",
          "Misc_116",
          "Misc_117",
          "Misc_118",
          "Misc_119",
          "Misc_120",
          "Misc_121",
          "Misc_122",
          "Misc_123",
          "Misc_124",
          "Misc_125",
          "Misc_126",
          "Misc_127",
          "Misc_128",
          "Misc_129",
          "Misc_130",
          "Misc_131",
          "Misc_132",
          "Misc_133",
          "Misc_134",
          "Misc_135",
          "Misc_136",
          "Misc_137",
          "Misc_138",
          "Misc_139",
          "Misc_140",
          "Misc_141",
          "Misc_142",
          "Misc_143",
          "Misc_144",
          "Misc_145",
          "Misc_146",
          "Misc_147",
          "Misc_148",
          "Misc_149",
          "Misc_150",
          "Misc_151",
          "Misc_152",
          "Misc_153",
          "Misc_154",
          "Misc_155",
          "Misc_156",
          "Misc_157",
          "Misc_158",
          "Misc_159",
          "Misc_160",
          "Misc_161",
          "Misc_162",
          "Misc_163",
          "Misc_164",
          "Neteller",
          "NordikCoin",
          "OchaPay",
          "online-bank-transfer",
          "Onlineueberweisen",
          "oriental-wallet",
          "OXXO",
          "P24",
          "PagoEffectivo",
          "Payco",
          "PaymentAsia-crypto",
          "payment-card",
          "Paymero",
          "Paymero-QR",
          "Paysafecash",
          "Paysafecard",
          "Pay4Fun",
          "PayPal",
          "PayU",
          "picpay",
          "PinPay",
          "PIX",
          "PIX-Automatico",
          "phone",
          "PhonePe",
          "POLi",
          "QIWI",
          "rapyd-checkout",
          "Samsung Pay",
          "SafetyPay",
          "Siirto",
          "Skrill",
          "SMSVoucher",
          "Sofort",
          "SparkPay",
          "Tether",
          "Thunes-Checkout",
          "Tupay",
          "UPI",
          "UPayCard",
          "USD-coin",
          "VegaWallet",
          "VenusPoint",
          "voucher",
          "voucher-2",
          "voucher-3",
          "voucher-4",
          "WeChat Pay",
          "Bancontact",
          "Bancontact-mobile",
          "Belfius-direct-net",
          "ING-homepay",
          "XPay-P2P",
          "XPay-QR",
          "Zimpler",
          "Wallet88",
          "Webpay",
          "Webpay-2",
          "Webpay Card"
        ]
      },
      "alternative": {
        "description": "Order using an alternative payment method.",
        "allOf": [
          {
            "$ref": "#/components/schemas/Order"
          },
          {
            "type": "object",
            "required": [
              "AlternativeMethod"
            ],
            "properties": {
              "AlternativeMethod": {
                "$ref": "#/components/schemas/AlternativeMethod"
              },
              "FinancialAccountId": {
                "type": "string",
                "readOnly": true,
                "description": "Unique financial account ID from the payment service."
              },
              "PaymentData": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                },
                "readOnly": true,
                "description": "Other alternative payment data that provides additional context about the payment.\n\nThis data is optional and may not be relevant for normal processing,\nbut can be useful to retain for audits or payment investigations.\n\nThis data is not intended to be parsed, and its structure is unreliable."
              }
            }
          }
        ]
      },
      "payment-card": {
        "description": "Order using a payment card.",
        "allOf": [
          {
            "$ref": "#/components/schemas/Order"
          },
          {
            "type": "object",
            "required": [
              "CardID",
              "PAN",
              "ExpMonth",
              "ExpYear",
              "CVV"
            ],
            "properties": {
              "CardID": {
                "description": "ID of the payment card.\nFor more information, see [Test cards](/mgs-api-definitions/mgs-api/section/test-cards).",
                "type": "string",
                "maxLength": 50
              },
              "PAN": {
                "description": "Primary account number (PAN), also known as the credit card number.\nThis is sensitive data.\nDo not use live PANs on this demo website, or within the Rebilly sandbox.\nOnly use live PANs in the Rebilly live environment.\n\nTo test various scenarios in the sandbox environment, use the test cards listed in [Test cards](/mgs-api-definitions/mgs-api/section/test-cards) and [Payouts test cards](/mgs-api-definitions/mgs-api/section/test-cards/payouts-test-cards).",
                "type": "string",
                "maxLength": 50,
                "example": "4111111111111111"
              },
              "ExpMonth": {
                "description": "Expiry month of the payment card, where 1 represents January and 12 represents December.",
                "type": "string",
                "maxLength": 2,
                "example": "11"
              },
              "ExpYear": {
                "description": "Four digit expiration year of the payment card.\nThis value must be a minimum of the current year, and a maximum of 50 years in the future.",
                "type": "string",
                "minLength": 4,
                "maxLength": 4,
                "example": "2023"
              },
              "IssuedMonth": {
                "description": "Month the card is issued,\nwhere 1 represents January and 12 represents December.\nThis field is mandatory for Switch, Solo, and UK Maestro cards.",
                "type": "string",
                "maxLength": 2,
                "example": "11"
              },
              "IssuedYear": {
                "description": "Year the card is issued,\nwhere 1 represents January and 12 represents December.\nThis field is mandatory for Switch, Solo, and UK Maestro cards.",
                "type": "string",
                "minLength": 4,
                "maxLength": 4,
                "example": "2017"
              },
              "CVV": {
                "description": "Three or four digit card verification value, also known as the CVC or CVV2.\nThis value is sensitive and must not be stored.",
                "type": "string",
                "minLength": 3,
                "maxLength": 4,
                "example": "123"
              }
            }
          }
        ]
      },
      "PaymentMethod": {
        "type": "string",
        "description": "Payment method.",
        "enum": [
          "payment-card",
          "alternative"
        ]
      },
      "ResourceId": {
        "type": "string",
        "description": "Resource ID.\nDefaults to UUID v4.",
        "maxLength": 50,
        "example": "4f6cf35x-2c4y-483z-a0a9-158621f77a21"
      },
      "ServerTimestamp": {
        "type": "string",
        "description": "Date and time when the resource is created or updated.",
        "format": "date-time",
        "readOnly": true
      },
      "Link": {
        "type": "object",
        "properties": {
          "rel": {
            "description": "Link type.",
            "type": "string",
            "enum": [
              "self",
              "approvalUrl"
            ]
          },
          "href": {
            "description": "Link URL.",
            "type": "string"
          }
        },
        "required": [
          "rel",
          "href"
        ]
      },
      "Links": {
        "type": "array",
        "description": "Links related to the resource.",
        "readOnly": true,
        "items": {
          "$ref": "#/components/schemas/Link"
        }
      },
      "BlankProblem": {
        "description": "Problem Details JSON Object [[RFC7807](https://tools.ietf.org/html/rfc7807)].",
        "type": "object",
        "minProperties": 1,
        "additionalProperties": true,
        "properties": {
          "status": {
            "type": "integer",
            "description": "HTTP status code.",
            "minimum": 400,
            "maximum": 599
          },
          "title": {
            "type": "string",
            "description": "Short, human-readable summary of the problem type.\nIt SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization."
          }
        }
      },
      "DocumentedProblem": {
        "type": "object",
        "allOf": [
          {
            "properties": {
              "type": {
                "type": "string",
                "description": "URI reference [[RFC3986](https://tools.ietf.org/html/rfc3986)] that identifies the problem type.\nIt should provide human-readable documentation for the problem type.\nWhen this member is not present, its value is assumed to be \"about:blank\".",
                "format": "uri",
                "example": "https://www.rebilly.com/docs/"
              }
            }
          },
          {
            "$ref": "#/components/schemas/BlankProblem"
          }
        ]
      },
      "DetailedProblem": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/BlankProblem"
          },
          {
            "properties": {
              "detail": {
                "type": "string",
                "description": "Human-readable explanation specific to this occurrence of the problem."
              }
            }
          }
        ]
      },
      "Problem": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/DocumentedProblem"
          },
          {
            "$ref": "#/components/schemas/DetailedProblem"
          }
        ]
      },
      "Unauthorized": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/Problem"
          },
          {
            "readOnly": true,
            "description": "Unauthorized.",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "https://www.rebilly.com/catalog/mgs-api#section/Errors/Unauthorized"
                ],
                "default": "https://www.rebilly.com/catalog/mgs-api#section/Errors/Unauthorized"
              },
              "status": {
                "type": "integer",
                "enum": [
                  401
                ],
                "default": 401
              },
              "title": {
                "type": "string",
                "enum": [
                  "The request has not been applied because it lacks valid authentication credentials for the target resource."
                ],
                "default": "The request has not been applied because it lacks valid authentication credentials for the target resource."
              }
            }
          }
        ]
      },
      "AccessForbidden": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/Problem"
          },
          {
            "readOnly": true,
            "description": "Access forbidden.",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "https://www.rebilly.com/catalog/mgs-api#section/Errors/AccessForbidden"
                ],
                "default": "https://www.rebilly.com/catalog/mgs-api#section/Errors/AccessForbidden"
              },
              "status": {
                "type": "integer",
                "enum": [
                  403
                ],
                "default": 403
              },
              "title": {
                "type": "string",
                "enum": [
                  "The server understood the request but refuses to authorize it."
                ],
                "default": "The server understood the request but refuses to authorize it."
              }
            }
          }
        ]
      },
      "ResourceNotFound": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/Problem"
          },
          {
            "readOnly": true,
            "description": "Resource not found.",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "https://www.rebilly.com/_spec/catalog/mgs-api#section/Errors/ResourceNotFound"
                ],
                "default": "https://www.rebilly.com/_spec/catalog/mgs-api#section/Errors/ResourceNotFound"
              },
              "status": {
                "type": "integer",
                "enum": [
                  404
                ],
                "default": 404
              },
              "title": {
                "type": "string",
                "enum": [
                  "The origin server did not find a current representation for the target resource or is not willing to disclose that one exists."
                ],
                "default": "The origin server did not find a current representation for the target resource or is not willing to disclose that one exists."
              }
            }
          }
        ]
      },
      "Conflict": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/Problem"
          },
          {
            "readOnly": true,
            "description": "Conflict with another resource found.",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "https://www.rebilly.com/catalog/mgs-api#section/Errors/Conflict"
                ],
                "default": "https://www.rebilly.com/catalog/mgs-api#section/Errors/Conflict"
              },
              "status": {
                "type": "integer",
                "enum": [
                  409
                ],
                "default": 409
              },
              "title": {
                "type": "string",
                "enum": [
                  "The request could not be completed due to a conflict with the current state of existing resources."
                ],
                "default": "The request could not be completed due to a conflict with the current state of existing resources."
              }
            }
          }
        ]
      },
      "ValidationErrorExtensions": {
        "type": "object",
        "properties": {
          "invalidFields": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string",
                  "description": "Name of the field.\nDot notation is used for nested object field names."
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "example": [
              {
                "field": "field1",
                "message": "field1 is invalid"
              },
              {
                "field": "subObject.field2",
                "message": "field2 is invalid"
              },
              {
                "field": "subObject.field2",
                "message": "another error in the field2"
              }
            ]
          }
        }
      },
      "ValidationError": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/Problem"
          },
          {
            "$ref": "#/components/schemas/ValidationErrorExtensions"
          },
          {
            "readOnly": true,
            "description": "Invalid data sent.",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "https://www.rebilly.com/catalog/mgs-api#section/Errors/ValidationError"
                ],
                "default": "https://www.rebilly.com/catalog/mgs-api#section/Errors/ValidationError"
              },
              "status": {
                "type": "integer",
                "enum": [
                  422
                ],
                "default": 422
              },
              "title": {
                "type": "string",
                "enum": [
                  "The request is invalid."
                ],
                "default": "The request is invalid."
              }
            }
          }
        ]
      },
      "Payout": {
        "type": "object",
        "required": [
          "PayoutExportReference",
          "PayoutMethod",
          "CasinoID",
          "PlayerID",
          "OrderCurrency",
          "OrderAmount",
          "NotificationURL",
          "GatewayAccountID"
        ],
        "properties": {
          "PayoutMethod": {
            "$ref": "#/components/schemas/AlternativeMethod"
          },
          "CardID": {
            "description": "ID of the card.\nThis ID maps to a payment card in Rebilly.\nThis field is required when the payout method is `payment-card`.\nFor test cards, see [Test cards](/mgs-api-definitions/mgs-api/section/test-cards).",
            "type": "string",
            "example": "411111"
          },
          "FinancialAccountID": {
            "description": "ID of the account to be paid.\nThis field is required when the payout method is `alternative`.",
            "type": "string",
            "example": "123-456-789-abc-ef1-234-567"
          },
          "TransactionID": {
            "description": "ID of the transaction.\nThis value is unique for the merchant in Rebilly.\nRebilly attempts to use the `PayoutExportReference` value,\nbut if the value is not unique, a variation is generated.",
            "readOnly": true,
            "example": "22_4567899",
            "allOf": [
              {
                "$ref": "#/components/schemas/ResourceId"
              }
            ]
          },
          "PayoutExportReference": {
            "description": "Payout identifier, also known as the payment export reference.\nTo prevent duplicates,\nthis value must be unique for the merchant within a 24-hour period.",
            "example": "22_4567899",
            "allOf": [
              {
                "$ref": "#/components/schemas/ResourceId"
              }
            ]
          },
          "GatewayAccountID": {
            "description": "ID of the merchant account to be used for the payout.",
            "type": "string",
            "example": "rebilly_001"
          },
          "CasinoID": {
            "description": "ID of the casino.\nThis value maps to a website ID in Rebilly.",
            "example": "22",
            "allOf": [
              {
                "$ref": "#/components/schemas/ResourceId"
              }
            ]
          },
          "GSID": {
            "description": "ID of the gaming server.\nThis value maps to an organization ID in Rebilly.",
            "example": "45",
            "allOf": [
              {
                "$ref": "#/components/schemas/ResourceId"
              }
            ],
            "readOnly": true
          },
          "PlayerID": {
            "description": "ID of the player.\nThis value maps to a `customer` in Rebilly.\nIt is composed of two parts concatenated by an underscore.\nThe first part is the registration casino ID, and the second part is the user ID.",
            "example": "22_112233",
            "allOf": [
              {
                "$ref": "#/components/schemas/ResourceId"
              }
            ]
          },
          "OrderCurrency": {
            "description": "Three character [ISO 4217 alpha-3 code](https://en.wikipedia.org/wiki/ISO_4217).\nThis value must be configured in the gateway account.",
            "type": "string",
            "example": "USD",
            "format": "ISO-4217-alpha-3"
          },
          "OrderAmount": {
            "description": "Payment amount with no currency symbol.\nIt is important to check the `PurchaseAmount`,\nwhich may be different from the `OrderAmount` if the player changed the order mid-process,\nwhich could be due to an upsell or bump scenario.",
            "type": "string",
            "example": "45.00"
          },
          "BillingCurrency": {
            "description": "Three character [ISO 4217 alpha-3 code](https://en.wikipedia.org/wiki/ISO_4217).\nWhen dynamic currency conversion occurs, this is the currency paid out.",
            "type": "string",
            "readOnly": true,
            "example": "USD",
            "format": "ISO-4217-alpha-3"
          },
          "BillingAmount": {
            "description": "Amount billed.\nWhen dynamic currency conversion occurs, this is the amount of the currency paid out.",
            "type": "string",
            "readOnly": true,
            "example": "45.00"
          },
          "BillingDescriptor": {
            "description": "Billing descriptor that is displayed on the cardholder's billing statement.",
            "type": "string",
            "readOnly": true,
            "example": "My descriptor"
          },
          "NotificationURL": {
            "description": "For offsite payments that require third-party verification,\nthis URL is called by the system when the payment returns from the offsite process.\n\nIf the transaction times out or an other exceptional type of transaction occurs,\nthis URL is used to update when the `result` changes from `unknown` to another value.",
            "type": "string",
            "format": "url"
          },
          "ExtraData": {
            "type": "object",
            "description": "Extra data list as a map `{\"field name\": \"custom value\", ...}`.\n\nThe format must follow the saved format.\nRecommended fields are `BannerTagId`, `RegistrationDate`, and `DeviceFingerprint`.\nIf a global or master user ID is available, that would be appropriate too.\n\nTo test within the sandbox,\nuse these magic values to simulate different outcomes with `DesiredResult` as the key:\n\n| Magic value           | Description                                                                                            |\n| ---------------------- | ------------------------------------------------------------------------------------------------------ |\n| `approved`             | Transaction with an `approved` result and `completed` status.                           |\n| `declined`             | Transaction with a `declined` result and `completed` status.                           |\n| `timeout-approved`     | Transaction with a `timeout` status and an `unknown` result. After approximately 5 minutes, the timeout becomes resolved and has an `approved` result with a `completed` status. |\n| `timeout-declined`     | Transaction with a `timeout` status and an `unknown` result. After approximately 5 minutes, the timeout becomes resolved and has a `declined` result and a `completed` status. |\n| `conn-error-declined`  | Transaction with a `conn-error` status and an `unknown` result. After approximately 5 minutes, it resolves and becomes result `declined` and status `completed`. |\n| `sending-declined`     | Transaction with a `sending` status and an `unknown` result. After 5 minutes, it resolves and becomes `declined` or `completed`. |\n| `pending-approved`     | Transaction with a `pending` status and an `unknown` result. After 5 minutes, it resolves to `approved` or `completed`. |",
            "example": {
              "BannerTagId": "123|456|789|098|765|543|210",
              "RegistrationDate": "2017-03-23",
              "DeviceFingerprint": "23932819301914985",
              "DesiredResult": "approved"
            }
          },
          "Status": {
            "description": "Status of the payout.\nSome status values require special handling, such as:\n\n- `timeout` (or `conn-error`): Rebilly polls the gateway to determine\nif the payout is processed.\nThe payout should be held open until a determination is made.\nRebilly sends a notification to the `NotificationURL` upon resolution of the `timeout` and `conn-error` states.\n- `waiting-gateway`: Rebilly polls final status and sends a notification to `NotificationURL` when the payout is completed.",
            "type": "string",
            "readOnly": true,
            "enum": [
              "pending",
              "sending",
              "timeout",
              "conn-error",
              "never-sent",
              "completed",
              "waiting-gateway"
            ],
            "example": "completed"
          },
          "Result": {
            "description": "Result of the payout.\nA result of `unknown` means the payout should be held open or pending for future changes.\nThis may happen because of a timeout or because interaction is necessary for further processing.",
            "type": "string",
            "readOnly": true,
            "enum": [
              "approved",
              "declined",
              "canceled",
              "abandoned",
              "unknown"
            ]
          },
          "Acquirer": {
            "description": "Acquirer used for the payment.",
            "type": "string",
            "readOnly": true,
            "example": "Natwest"
          },
          "ResponseCode": {
            "description": "Code that maps to a message.\nThe code is a string number between `0` and `1000`.\nFor more information, see Rebilly response codes.",
            "type": "string",
            "readOnly": true,
            "example": "00"
          },
          "ResponseMessage": {
            "description": "Message mapped from the response code.",
            "type": "string",
            "readOnly": true,
            "example": "Successful approval"
          },
          "ResponseCodeGateway": {
            "description": "Response code from the downstream gateway.",
            "type": "string",
            "readOnly": true,
            "example": "00"
          },
          "ResponseMessageGateway": {
            "description": "Message mapped from the response code from the gateway.",
            "type": "string",
            "readOnly": true,
            "example": "Approved transaction"
          },
          "GatewayTransactionID": {
            "description": "Transaction identifier from the processor or gateway.",
            "type": "string",
            "readOnly": true,
            "example": "11111-22222-33333-44444"
          },
          "CreatedTime": {
            "description": "Date and time when the payout is created.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ServerTimestamp"
              }
            ]
          },
          "UpdatedTime": {
            "description": "Date and time when the payout is updated.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ServerTimestamp"
              }
            ]
          },
          "_links": {
            "$ref": "#/components/schemas/Links"
          }
        }
      },
      "PaymentInstrumentGeneric": {
        "type": "object",
        "required": [
          "PayoutMethod",
          "FinancialAccountID"
        ],
        "properties": {
          "PayoutMethod": {
            "$ref": "#/components/schemas/AlternativeMethod"
          },
          "FinancialAccountID": {
            "description": "Rebilly payment instrument ID or external account ID.\nThis field is used to pay out to specific alternative methods.",
            "type": "string",
            "example": "adam@rebilly.com"
          }
        }
      },
      "PaymentInstrumentMGSCardID": {
        "type": "object",
        "required": [
          "PayoutMethod",
          "CardID"
        ],
        "properties": {
          "PayoutMethod": {
            "type": "string",
            "description": "Values available for this type of payout.",
            "enum": [
              "payment-card"
            ]
          },
          "CardID": {
            "description": "ID of the card.\nThis ID maps to a payment card in Rebilly.\nRequired when the payout method is `payment-card`.\nFor more information, see [Test cards](/mgs-api-definitions/mgs-api/section/test-cards).",
            "type": "string",
            "example": "45671231"
          }
        }
      },
      "PaymentInstrumentBankAccount": {
        "type": "object",
        "required": [
          "AccountNumberType"
        ],
        "discriminator": {
          "propertyName": "AccountNumberType",
          "mapping": {
            "BBAN": "#/components/schemas/BBANType",
            "IBAN": "#/components/schemas/IBANType"
          }
        },
        "properties": {
          "PayoutMethod": {
            "type": "string",
            "enum": [
              "echeck",
              "Interac-express-connect",
              "swift-dbt"
            ]
          },
          "AccountNumberType": {
            "description": "Type of bank account number.\nThis field accepts a Basic Bank Account Number (BBAN) or an International Bank Account Number (IBAN).",
            "type": "string",
            "default": "BBAN",
            "enum": [
              "IBAN",
              "BBAN"
            ]
          },
          "SINLast4": {
            "description": "Last 4 of the social insurance number.",
            "type": "string",
            "example": "1234"
          }
        }
      },
      "BBANType": {
        "description": "BBAN type object.",
        "allOf": [
          {
            "$ref": "#/components/schemas/PaymentInstrumentBankAccount"
          },
          {
            "type": "object",
            "required": [
              "AccountNumber",
              "RoutingNumber"
            ],
            "properties": {
              "AccountNumber": {
                "description": "Basic Bank Account Number (BBAN).\nA BBAN is a unique identifier for a bank account in a specific country.\nIt consists of bank code, branch code, and account number.",
                "type": "string",
                "pattern": "^[0-9]+$"
              },
              "RoutingNumber": {
                "description": "Bank routing number.\nA routing number is a unique identifier for a bank account.\nIn Canada, a routing number consists of a five digit transit number, also called branch number, and a three digit financial institution number.\nTogether, these numbers identify the branch where the account is held and the financial institution.",
                "type": "string",
                "pattern": "^[0-9]+$"
              },
              "AccountType": {
                "description": "Type of bank account.",
                "type": "string",
                "enum": [
                  "checking",
                  "savings",
                  "other"
                ],
                "default": "checking"
              },
              "BankName": {
                "description": "Name of the bank.",
                "type": "string"
              },
              "Bic": {
                "description": "Bank Identifier Code (BIC).\nProvides bank identification for SWIFT, SEPA, and other international transfers.",
                "type": "string"
              }
            }
          }
        ]
      },
      "IBANType": {
        "description": "IBAN type object.",
        "allOf": [
          {
            "$ref": "#/components/schemas/PaymentInstrumentBankAccount"
          },
          {
            "type": "object",
            "required": [
              "AccountNumber"
            ],
            "properties": {
              "AccountNumber": {
                "description": "International Bank Account Number (IBAN).\nAn IBAN is a unique identifier for a bank account that is used for international transfers.",
                "type": "string",
                "pattern": "^[a-zA-Z]{2}[0-9]{2}[a-zA-Z0-9]{4}[0-9]{7}([a-zA-Z0-9]?){0,16}$"
              },
              "BankName": {
                "description": "Name of the bank.",
                "type": "string"
              },
              "Bic": {
                "description": "Bank Identifier Code (BIC).\nProvides bank identification for SWIFT, SEPA, and other international transfers.",
                "type": "string"
              }
            }
          }
        ]
      },
      "PaymentInstrumentInteracETransfer": {
        "type": "object",
        "required": [
          "PayoutMethod",
          "Email",
          "Mobile"
        ],
        "properties": {
          "PayoutMethod": {
            "type": "string",
            "description": "Values available for this type of payout.",
            "enum": [
              "Interac-eTransfer"
            ]
          },
          "Email": {
            "description": "Customer's email address.",
            "type": "string",
            "format": "email",
            "example": "adam@rebilly.com"
          },
          "Mobile": {
            "description": "Customer's 10-digit phone number.",
            "type": "string",
            "minLength": 10,
            "maxLength": 10,
            "example": "5145551212"
          }
        }
      },
      "PayoutCreate": {
        "type": "object",
        "required": [
          "PayoutExportReference",
          "PayoutMethod",
          "CasinoID",
          "PlayerID",
          "OrderCurrency",
          "OrderAmount",
          "NotificationURL",
          "PaymentInstrument"
        ],
        "properties": {
          "PaymentInstrument": {
            "description": "Details pf the payment instrument used to make the payout.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/PaymentInstrumentGeneric"
              },
              {
                "$ref": "#/components/schemas/PaymentInstrumentMGSCardID"
              },
              {
                "$ref": "#/components/schemas/PaymentInstrumentBankAccount"
              },
              {
                "$ref": "#/components/schemas/PaymentInstrumentInteracETransfer"
              }
            ]
          },
          "DOB": {
            "description": "Player's date of birth in [ISO 8601 full-date format (yyyy-mm-dd)](http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14).",
            "type": "string",
            "format": "date"
          },
          "IpAddress": {
            "description": "IPv4 address in dotted decimal format.",
            "type": "string",
            "format": "ipv4",
            "example": "127.0.0.1"
          },
          "Email": {
            "description": "Player's email address.\nThe email must match an email regex, and also be at a domain with a valid MX record.\nRebilly does not send any emails.",
            "type": "string",
            "format": "email",
            "example": "user@example.com"
          },
          "FirstName": {
            "description": "Player's first name.",
            "type": "string",
            "minLength": 3,
            "maxLength": 45,
            "example": "Arnold"
          },
          "LastName": {
            "description": "Player's last name.",
            "type": "string",
            "minLength": 3,
            "maxLength": 45,
            "example": "Schwartzenegger"
          },
          "Address": {
            "description": "Player's street address.",
            "type": "string",
            "maxLength": 60,
            "example": "31 Guild Street"
          },
          "Address2": {
            "description": "Player's second line of street address.",
            "type": "string",
            "maxLength": 60,
            "example": "Apartment 2"
          },
          "City": {
            "description": "Player's city.",
            "type": "string",
            "maxLength": 45,
            "example": "London"
          },
          "Region": {
            "description": "Player's state, province, territory, parish, or region.",
            "type": "string",
            "maxLength": 45,
            "example": "Westminster"
          },
          "Country": {
            "description": "Player's country in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.",
            "type": "string",
            "maxLength": 2,
            "example": "GB",
            "format": "ISO-3166-1-alpha-2"
          },
          "PostalCode": {
            "description": "Player's postal code, also known as the post code or zip code.",
            "type": "string",
            "maxLength": 10,
            "example": "E8 6XD"
          },
          "PhoneNumber": {
            "description": "Player's telephone number, which may be either a landline or mobile.",
            "type": "string",
            "maxLength": 20,
            "example": "077 8826 0192"
          },
          "PayoutExportReference": {
            "description": "Payout identifier, also known as the payment export reference.\nThis must be unique for the merchant within a 24-hour period,\nto prevent duplicate requests.",
            "example": "22_4567899",
            "allOf": [
              {
                "$ref": "#/components/schemas/ResourceId"
              }
            ]
          },
          "GatewayAccountID": {
            "description": "ID of the merchant account to be used for the payout.",
            "type": "string",
            "example": "rebilly_001"
          },
          "CasinoID": {
            "description": "ID of the casino.\nThis value maps to a website ID in Rebilly.",
            "example": "22",
            "allOf": [
              {
                "$ref": "#/components/schemas/ResourceId"
              }
            ]
          },
          "GSID": {
            "description": "ID of the gaming server.\nThis value maps to an organization ID in Rebilly.",
            "example": "45",
            "allOf": [
              {
                "$ref": "#/components/schemas/ResourceId"
              }
            ],
            "readOnly": true
          },
          "PlayerID": {
            "description": "ID of the player.\nThis value maps to a `customer` in Rebilly.\nIt is composed of two parts concatenated by an underscore.\nThe first part is the registration casino ID, and the second part is the user ID.",
            "example": "22_112233",
            "allOf": [
              {
                "$ref": "#/components/schemas/ResourceId"
              }
            ]
          },
          "OrderCurrency": {
            "description": "Three character [ISO 4217 alpha-3 code](https://en.wikipedia.org/wiki/ISO_4217).\nThis value must be configured in the gateway account.",
            "type": "string",
            "example": "USD",
            "format": "ISO-4217-alpha-3"
          },
          "OrderAmount": {
            "description": "Payment amount with no currency symbol.",
            "type": "string",
            "example": "45.00"
          },
          "BillingCurrency": {
            "description": "Three character [ISO 4217 alpha-3 code](https://en.wikipedia.org/wiki/ISO_4217).\nWhen dynamic currency conversion occurs, this is the currency paid out.",
            "type": "string",
            "readOnly": true,
            "example": "USD",
            "format": "ISO-4217-alpha-3"
          },
          "BillingAmount": {
            "description": "Amount billed.\nWhen dynamic currency conversion occurs, this is the amount of the currency paid out.",
            "type": "string",
            "readOnly": true,
            "example": "45.00"
          },
          "BillingDescriptor": {
            "description": "Billing descriptor that is displayed on the cardholders billing statement (read-only).",
            "type": "string",
            "readOnly": true,
            "example": "My descriptor"
          },
          "NotificationURL": {
            "description": "For offsite payments that require third-party verification,\nthis URL is called by the system when the payment returns from the offsite process.\n\nIf the transaction times out or an other exceptional type of transaction occurs,\nthis URL is used to update when the `result` changes from `unknown` to another value.",
            "type": "string",
            "format": "url"
          },
          "ExtraData": {
            "type": "object",
            "description": "Extra data list as a map `{\"field name\": \"custom value\", ...}`.\n\nThe format must follow the saved format.\nRecommended fields are `BannerTagId`, `RegistrationDate`, and `DeviceFingerprint`.\nIf a global or master user ID is available, that would be appropriate too.",
            "example": {
              "BannerTagId": "123|456|789|098|765|543|210",
              "RegistrationDate": "2017-03-23",
              "DeviceFingerprint": "23932819301914985"
            }
          },
          "Status": {
            "description": "Status of the payout.\nSome status values require special handling, such as:\n\n- `timeout` (or `conn-error`): Rebilly polls the gateway to determine\nif the payout is processed.\nThe payout should be held open until a determination is made.\nRebilly sends a notification to the `NotificationURL` upon resolution of the `timeout` and `conn-error` states.\n- `waiting-gateway`: Rebilly polls final status and sends a notification to `NotificationURL` when the payout is completed.",
            "type": "string",
            "readOnly": true,
            "enum": [
              "pending",
              "sending",
              "timeout",
              "waiting-gateway",
              "conn-error",
              "never-sent",
              "completed"
            ],
            "example": "completed"
          },
          "Result": {
            "description": "Result of the payout.\nA result of `unknown` means the payout should be held open or pending for future changes.\nThis may happen because of a timeout or because interaction is necessary for further processing.",
            "type": "string",
            "readOnly": true,
            "enum": [
              "approved",
              "declined",
              "canceled",
              "abandoned",
              "unknown"
            ]
          },
          "Acquirer": {
            "description": "Acquirer used for the payment.",
            "type": "string",
            "readOnly": true,
            "example": "Natwest"
          },
          "ResponseCode": {
            "description": "Code that maps to a message.\nThe code is a string number between `0` and `1000`.\nFor more information, see Rebilly response codes.",
            "type": "string",
            "readOnly": true,
            "example": "00"
          },
          "ResponseMessage": {
            "description": "Message mapped from the response code.",
            "type": "string",
            "readOnly": true,
            "example": "Successful approval"
          },
          "ResponseCodeGateway": {
            "description": "Response code from the downstream gateway.",
            "type": "string",
            "readOnly": true,
            "example": "00"
          },
          "ResponseMessageGateway": {
            "description": "Message mapped from the response code from the gateway.",
            "type": "string",
            "readOnly": true,
            "example": "Approved transaction"
          },
          "GatewayTransactionID": {
            "description": "Transaction identifier from the processor or gateway.",
            "type": "string",
            "readOnly": true,
            "example": "11111-22222-33333-44444"
          },
          "CreatedTime": {
            "description": "Date and time when the payout is created.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ServerTimestamp"
              }
            ]
          },
          "UpdatedTime": {
            "description": "Date and time when the payout is updated.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ServerTimestamp"
              }
            ]
          },
          "_links": {
            "$ref": "#/components/schemas/Links"
          }
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Unauthorized.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Unauthorized"
            }
          },
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Unauthorized"
            }
          }
        }
      },
      "AccessForbidden": {
        "description": "Access forbidden.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AccessForbidden"
            }
          },
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/AccessForbidden"
            }
          }
        }
      },
      "ResourceNotFound": {
        "description": "Resource not found.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ResourceNotFound"
            }
          },
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ResourceNotFound"
            }
          }
        }
      },
      "Conflict": {
        "description": "Conflict.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Conflict"
            }
          },
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Conflict"
            }
          }
        }
      },
      "ValidationError": {
        "description": "Invalid data sent.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ValidationError"
            }
          },
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ValidationError"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/orders": {
      "get": {
        "tags": [
          "Orders"
        ],
        "summary": "Search orders",
        "operationId": "getOrderCollection",
        "parameters": [
          {
            "$ref": "#/components/parameters/collectionFilter"
          },
          {
            "$ref": "#/components/parameters/collectionSort"
          },
          {
            "$ref": "#/components/parameters/organizationId"
          }
        ],
        "description": "Searches orders.\nRecommended to filter by `OrderID` (eg.\n`?filter=OrderID:1234_567890`).",
        "responses": {
          "200": {
            "description": "Orders retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Order"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/AccessForbidden"
          },
          "404": {
            "$ref": "#/components/responses/ResourceNotFound"
          }
        }
      }
    },
    "/orders/{OrderID}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/resourceId"
        }
      ],
      "put": {
        "tags": [
          "Orders"
        ],
        "summary": "Create an order",
        "operationId": "createOrder",
        "parameters": [
          {
            "$ref": "#/components/parameters/organizationId"
          }
        ],
        "description": "Creates an order with specified identifier string\nIf you cannot make a `PUT` request,\nyou can make a `POST` request instead with the same structure.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Order"
              }
            }
          },
          "description": "Order resource.",
          "required": true
        },
        "responses": {
          "201": {
            "description": "Order created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/AccessForbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "500": {
            "description": "Rebilly error.\nPlease contact us to report problem."
          },
          "503": {
            "description": "Rebilly server timeout error.\nPlease contact us to report problem."
          }
        }
      },
      "get": {
        "tags": [
          "Orders"
        ],
        "summary": "Retrieve an order",
        "operationId": "getOrder",
        "parameters": [
          {
            "$ref": "#/components/parameters/organizationId"
          }
        ],
        "description": "Retrieve an order with specified identifier string.",
        "responses": {
          "200": {
            "description": "Order retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/AccessForbidden"
          },
          "404": {
            "$ref": "#/components/responses/ResourceNotFound"
          }
        }
      }
    },
    "/pay-outs": {
      "get": {
        "tags": [
          "Payouts"
        ],
        "summary": "Search payouts",
        "operationId": "getPayoutCollection",
        "parameters": [
          {
            "$ref": "#/components/parameters/collectionFilter"
          },
          {
            "$ref": "#/components/parameters/collectionSort"
          },
          {
            "$ref": "#/components/parameters/organizationId"
          }
        ],
        "description": "Searches payouts.\nRecommended to filter by `OrderID` (eg.\n`?filter=OrderID:1234_567890`).",
        "responses": {
          "200": {
            "description": "Payouts retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Payout"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/AccessForbidden"
          },
          "404": {
            "$ref": "#/components/responses/ResourceNotFound"
          }
        }
      }
    },
    "/pay-outs/{OrderID}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/resourceId"
        }
      ],
      "get": {
        "tags": [
          "Payouts"
        ],
        "summary": "Retrieve a payout",
        "operationId": "getPayout",
        "parameters": [
          {
            "$ref": "#/components/parameters/organizationId"
          }
        ],
        "description": "Retrieve a payout with specified identifier string.",
        "responses": {
          "200": {
            "description": "Payout retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payout"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/AccessForbidden"
          },
          "404": {
            "$ref": "#/components/responses/ResourceNotFound"
          }
        }
      },
      "put": {
        "tags": [
          "Payouts"
        ],
        "summary": "Create a payout",
        "description": "Creates a payout for either Rebilly-originated (exposure) payments by using the Rebilly `FinancialAccountID` or the MGS `CardID`.\nAlternatively, you can create any non-exposure payouts by supplying the gateway account ID or payment instrument required to complete the payout.\n\n\n\n\nThis API is stable and Rebilly plans to extend it with additional types of payment instruments.\n\n\nRebilly creates the customer if it does not exist.",
        "operationId": "createPayout",
        "parameters": [
          {
            "$ref": "#/components/parameters/organizationId"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PayoutCreate"
              }
            }
          },
          "description": "Payout resource.",
          "required": true
        },
        "responses": {
          "201": {
            "description": "Payout created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payout"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/AccessForbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "500": {
            "description": "Rebilly error.\nPlease contact us to report problem."
          },
          "503": {
            "description": "Rebilly server timeout error.\nPlease contact us to report problem."
          }
        }
      }
    },
    "/cashier": {
      "post": {
        "security": [],
        "tags": [
          "Cashier"
        ],
        "summary": "Redirect to cashier",
        "operationId": "redirectToCashier",
        "description": "Accepts form data from a browser form post and redirects to the cashier\nwith a `303 See Other` redirect.\nUse this endpoint to open an iframe in the browser.\nAfter the player has completed the payment or exits the cashier,\nthey are redirected to the `returnUrl`.",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "bankingPublicUrl",
                  "returnUrl",
                  "userSessionToken"
                ],
                "properties": {
                  "bankingPublicUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "Public banking API URL."
                  },
                  "returnUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL to redirect to after processing."
                  },
                  "userSessionToken": {
                    "type": "string",
                    "description": "Bearer access token for authentication to the public banking API."
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "303": {
            "description": "Redirect to the specified `returnUrl` after the player has completed the payment.",
            "headers": {
              "Location": {
                "description": "Location, or `returnUrl`, where the player is redirected after the payment is completed.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - missing required fields or invalid URL."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/AccessForbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          }
        }
      }
    }
  }
}