{
   "openapi": "3.0.1",
   "info": {
      "version": "2.0.0",
      "title": "Pricing API",
      "x-metaTitle": "Vonage Pricing API Reference | Vonage API Documentation",
      "x-metaDescription": "Find quick answers to questions about the Vonage Pricing API in this reference guide. Learn more in Vonage's API documentation.",
      "description": "The Pricing API enabled the retrieval of Vonage services pricing information. Please note the Pricing API is rate limited to one request per second.",
      "contact": {
         "name": "Vonage DevRel",
         "email": "devrel@vonage.com",
         "url": "https://developer.vonage.com/"
      }
   },
   "servers": [
      {
         "url": "https://api.nexmo.com/v2/account"
      }
   ],
   "paths": {
      "/pricing/{product}": {
         "get": {
            "security": [
               {
                  "basicAuth": []
               }
            ],
            "summary": "Retrieve pricing.",
            "operationId": "retrievePricing",
            "description": "Retrieves the pricing information for a certain product.\n",
            "parameters": [
               {
                  "$ref": "#/components/parameters/product"
               },
               {
                  "name": "country",
                  "in": "query",
                  "description": "A two letter [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). For example, `CA`.",
                  "required": true,
                  "schema": {
                     "type": "string"
                  }
               },
               {
                  "name": "page",
                  "in": "query",
                  "description": "The page number of the results to retrieve.",
                  "required": false,
                  "schema": {
                     "type": "integer"
                  }
               },
               {
                  "name": "page_size",
                  "in": "query",
                  "description": "The number of results to retrieve per page.",
                  "required": false,
                  "schema": {
                     "type": "integer"
                  }
               }
            ],
            "responses": {
               "200": {
                  "description": "Pricing information for a specific product.",
                  "content": {
                     "application/json": {
                        "schema": {
                           "$ref": "#/components/schemas/PricingResponse"
                        }
                     }
                  }
               },
               "401": {
                  "description": "Authentication failure",
                  "content": {
                     "application/json": {
                        "schema": {
                           "oneOf": [
                              {
                                 "$ref": "#/components/schemas/ErrorUnauthorizedMissingCredentials"
                              }
                           ]
                        }
                     }
                  }
               },
               "402": {
                  "description": "Payment Required",
                  "content": {
                     "application/json": {
                        "schema": {
                           "$ref": "#/components/schemas/ErrorPaymentRequired"
                        }
                     }
                  }
               },
               "404": {
                  "description": "Not Found. The product is not known.",
                  "content": {
                     "application/json": {
                        "schema": {
                           "$ref": "#/components/schemas/ErrorNotFound"
                        }
                     }
                  }
               },
               "429": {
                  "description": "Too Many Requests",
                  "content": {
                     "application/json": {
                        "schema": {
                           "$ref": "#/components/schemas/ErrorThrottled"
                        }
                     }
                  }
               },
               "500": {
                  "description": "Internal error",
                  "content": {
                     "application/json": {
                        "schema": {
                           "$ref": "#/components/schemas/ErrorInternal"
                        }
                     }
                  }
               }
            }
         }
      }
   },
   "components": {
      "securitySchemes": {
         "basicAuth": {
            "type": "http",
            "scheme": "basic"
         }
      },
      "parameters": {
         "product": {
            "name": "product",
            "in": "path",
            "description": "The product for which you want to retrieve pricing information.",
            "required": true,
            "example": "sms-outbound",
            "schema": {
               "type": "string",
               "enum": [
                  "sms-outbound",
                  "voice-outbound"
               ]
            }
         }
      },
      "schemas": {
         "PricingResponse": {
            "properties": {
               "page_size": {
                  "example": "100",
                  "type": "string",
                  "description": "The number of results per page."
               },
               "page": {
                  "example": "1",
                  "type": "string",
                  "description": "The page number of the results."
               },
               "total_items": {
                  "example": "243",
                  "type": "string",
                  "description": "The total number of items."
               },
               "total_pages": {
                  "example": "3",
                  "type": "string",
                  "description": "The total number of pages."
               },
               "_embedded": {
                  "type": "object",
                  "properties": {
                     "countries": {
                        "type": "array",
                        "description": "A list of countries.",
                        "items": {
                           "$ref": "#/components/schemas/CountryObject"
                        }
                     }
                  }
               },
               "_links": {
                  "type": "object",
                  "properties": {
                     "self": {
                        "type": "object",
                        "properties": {
                           "href": {
                              "type": "string",
                              "example": "https://api.nexmo.com/account/pricing/sms-outbound?page=1&page_size=100",
                              "description": "The URL to retrieve the current page."
                           }
                        }
                     },
                     "first": {
                        "type": "object",
                        "properties": {
                           "href": {
                              "type": "string",
                              "example": "https://api.nexmo.com/account/pricing/sms-outbound?page=1&page_size=100",
                              "description": "The URL to retrieve the first page."
                           }
                        }
                     },
                     "last": {
                        "type": "object",
                        "properties": {
                           "href": {
                              "type": "string",
                              "example": "https://api.nexmo.com/account/pricing/sms-outbound?page=3&page_size=100",
                              "description": "The URL to retrieve the last page."
                           }
                        }
                     },
                     "next": {
                        "type": "object",
                        "properties": {
                           "href": {
                              "type": "string",
                              "example": "https://api.nexmo.com/account/pricing/sms-outbound?page=2&page_size=100",
                              "description": "The URL to retrieve the next page."
                           }
                        }
                     },
                     "prev": {
                        "type": "object",
                        "properties": {
                           "href": {
                              "type": "string",
                              "example": "https://api.nexmo.com/account/pricing/sms-outbound?page=1&page_size=100",
                              "description": "The URL to retrieve the previous page."
                           }
                        }
                     }
                  }
               }
            }
         },
         "CountryObject": {
            "type": "object",
            "properties": {
               "country_name": {
                  "type": "string",
                  "example": "Canada",
                  "description": "Country name."
               },
               "dialing_prefix": {
                  "type": "string",
                  "example": "1",
                  "description": "The dialling prefix."
               },
               "dest_network_type": {
                  "type": "string",
                  "example": "ALL",
                  "description": "The type of network."
               },
               "group_internal_start": {
                  "type": "string",
                  "example": "1s",
                  "description": "TBD"
               },
               "rate_increment": {
                  "type": "string",
                  "example": "60",
                  "description": "The rate increment."
               },
               "currency": {
                  "type": "string",
                  "example": "USD",
                  "description": "The currency that your account is being billed in."
               },
               "price": {
                  "type": "string",
                  "example": "0.1",
                  "description": "The price."
               }
            }
         },
         "ErrorUnauthorizedMissingCredentials": {
            "description": "Missing or Invalid Credentials",
            "type": "object",
            "required": [
               "type",
               "title",
               "details",
               "instance"
            ],
            "properties": {
               "type": {
                  "type": "string",
                  "description": "Link to error / remediation options",
                  "example": "https://developer.vonage.com/api-errors/#unathorized"
               },
               "title": {
                  "type": "string",
                  "description": "Generic error message",
                  "example": "You did not provide correct credentials."
               },
               "detail": {
                  "type": "string",
                  "description": "Additional information about the error",
                  "example": "Check that you're using the correct credentials, and that your account has this feature enabled"
               },
               "instance": {
                  "type": "string",
                  "description": "Internal Trace ID",
                  "example": "bf0ca0bf927b3b52e3cb03217e1a1ddf"
               }
            }
         },
         "ErrorPaymentRequired": {
            "type": "object",
            "required": [
               "type",
               "title",
               "detail",
               "instance"
            ],
            "properties": {
               "type": {
                  "type": "string",
                  "description": "Link to error / remediation options",
                  "example": "https://developer.vonage.com/api-errors/#low-balance"
               },
               "title": {
                  "type": "string",
                  "description": "Generic error message",
                  "example": "Low balance"
               },
               "detail": {
                  "type": "string",
                  "description": "Additional information about the error",
                  "example": "This request could not be performed due to your account balance being low."
               },
               "instance": {
                  "type": "string",
                  "description": "Internal Trace ID",
                  "example": "bf0ca0bf927b3b52e3cb03217e1a1ddf"
               }
            }
         },
         "ErrorNotFound": {
            "type": "object",
            "required": [
               "type",
               "title",
               "detail",
               "instance"
            ],
            "properties": {
               "type": {
                  "type": "string",
                  "description": "Link to error / remediation options",
                  "example": "https://developer.vonage.com/api-errors#not-found"
               },
               "title": {
                  "type": "string",
                  "description": "Generic error message",
                  "example": "Not Found"
               },
               "detail": {
                  "type": "string",
                  "description": "Additional information about the error",
                  "example": "Product `unknown` not found."
               },
               "instance": {
                  "type": "string",
                  "description": "Internal Trace ID",
                  "example": "bf0ca0bf927b3b52e3cb03217e1a1ddf"
               }
            }
         },
         "ErrorThrottled": {
            "type": "object",
            "required": [
               "type",
               "title",
               "detail",
               "instance"
            ],
            "properties": {
               "type": {
                  "type": "string",
                  "description": "Link to error / remediation options",
                  "example": "https://developer.vonage.com/api-errors#throttled"
               },
               "title": {
                  "type": "string",
                  "description": "Generic error message",
                  "example": "Rate Limit Hit"
               },
               "detail": {
                  "type": "string",
                  "description": "Additional information about the error",
                  "example": "Please wait, then retry your request"
               },
               "instance": {
                  "type": "string",
                  "description": "Internal Trace ID",
                  "example": "bf0ca0bf927b3b52e3cb03217e1a1ddf"
               }
            }
         },
         "ErrorInternal": {
            "type": "object",
            "required": [
               "type",
               "title",
               "detail",
               "instance"
            ],
            "properties": {
               "type": {
                  "type": "string",
                  "description": "Link to error / remediation options",
                  "example": "https://developer.vonage.com/api-errors#internal"
               },
               "title": {
                  "type": "string",
                  "description": "Generic error message",
                  "example": "Internal error"
               },
               "detail": {
                  "type": "string",
                  "description": "Additional information about the error",
                  "example": "There was an error processing your request in the Platform."
               },
               "instance": {
                  "type": "string",
                  "description": "Internal Trace ID",
                  "example": "bf0ca0bf927b3b52e3cb03217e1a1ddf"
               }
            }
         }
      }
   }
}