---
agentTools:
  projectIndex: https://docs.developer.yelp.com/llms.txt
---

# Get Opportunity

Get info that user provided (e.g. customer address) when they were checking if business can service them (e.g. business delivers to their address or has a reservation time slot).

The `opportunity_id` is provided to the Partner via the iframe URL and is the same token provided to the Partner when Yelp POSTs the user's customer address to check for delivery availability. This call is optional if the Partner temporarily caches the customer_address and opportunity token during the delivery availability check.

See [Opportunity](https://docs.developer.yelp.com/docs/resources#opportunity) resource for more info.

[block:callout]
{
  "type": "info",
  "body": "This endpoint is part of the Checkout API, visit [Checkout API](https://docs.developer.yelp.com/docs/checkout-api) to learn more."
}
[/block]

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Checkout API",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://partner-api.yelp.com/checkout"
    }
  ],
  "security": [
    {
      "basic": []
    }
  ],
  "components": {
    "securitySchemes": {
      "basic": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "paths": {
    "/opportunities/{opportunity_id}/v3": {
      "get": {
        "tags": [
          "Checkout API"
        ],
        "summary": "Get Opportunity",
        "operationId": "get_opportunity",
        "description": "Get info that user provided (e.g. customer address) when they were checking if business can service them (e.g. business delivers to their address or has a reservation time slot).\n\nThe `opportunity_id` is provided to the Partner via the iframe URL and is the same token provided to the Partner when Yelp POSTs the user's customer address to check for delivery availability. This call is optional if the Partner temporarily caches the customer_address and opportunity token during the delivery availability check.\n\nSee [Opportunity](https://docs.developer.yelp.com/docs/resources#opportunity) resource for more info.\n",
        "parameters": [
          {
            "name": "opportunity_id",
            "in": "path",
            "required": true,
            "description": "Unique identifier for this Opportunity",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved the opportunity.",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {
                      "opportunity_id": "unique identifier for this Opportunity",
                      "partner_business_id": "1234",
                      "request_time": 1544466453,
                      "service_type": "food",
                      "selected_option": "at_customer",
                      "availability_constraints": [
                        {
                          "object": "CustomerAddressConstraint",
                          "customer_address_str": "123 Main St., SF, 94102",
                          "customer_address": {
                            "object": "Address",
                            "address1": "123 Main St.",
                            "city": "San Francisco",
                            "postal_code": "94102"
                          }
                        }
                      ]
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "opportunity_id": {
                      "type": "string"
                    },
                    "partner_business_id": {
                      "type": "string"
                    },
                    "request_time": {
                      "type": "integer"
                    },
                    "service_type": {
                      "type": "string"
                    },
                    "selected_option": {
                      "type": "string"
                    },
                    "availability_constraints": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string"
                          },
                          "customer_address_str": {
                            "type": "string"
                          },
                          "customer_address": {
                            "type": "object",
                            "properties": {
                              "object": {
                                "type": "string"
                              },
                              "address1": {
                                "type": "string"
                              },
                              "city": {
                                "type": "string"
                              },
                              "postal_code": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": false,
    "samples-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 99,
      "1": 192,
      "2": 9,
      "3": 217,
      "4": 242,
      "5": 85,
      "6": 55,
      "7": 7,
      "8": 215,
      "9": 154,
      "10": 176,
      "11": 80
    }
  }
}
```