info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
OpenAPI specs for the Marketplace APIs are available at [Marketplace interactive API documentation](https://customers.staging.gitlab.com/openapi_docs/marketplace).
## Access the Marketplace API
To access the Marketplace API you need to:
- Request access from GitLab.
- Retrieve an OAuth access token.
Marketplace API endpoints are secured with [OAuth 2.0](https://oauth.net/2/). OAuth is an authorization framework
Before you can use the Marketplace API, you must contact your Marketplace partner Manager or email [`partnerorderops`](mailto:partnerorderops@gitlab.com)
- Make a POST request to the [`/oauth/token`](https://customers.staging.gitlab.com/openapi_docs/marketplace#/marketplace/post_oauth_token) endpoint with the following required parameters:
| `client_id` | string | yes |ID of your client application record on the Customers Portal. Received from GitLab. |
| `client_secret` | string | yes |Secret of your client application record on the Customers Portal. Received from GitLab. |
| `grant_type` | string | yes |Specifies the type of credential flow. Use `client_credentials`. |
| `scope` | string | yes |Specifies the level of access. Use `marketplace.order:read` for read-only access. Use `marketplace.order:create` for create access. |
If the request is successful, the response body includes the access token that you can use in subsequent requests. For an example of a successful
response, see the [Marketplace interactive API documentation](https://customers.staging.gitlab.com/openapi_docs/marketplace)
If the request is unsuccessful, the response body includes an error and error description. The errors can be:
| `customer` | object | yes | Information about the customer. Must include company name. Contact must include `firstName`, `lastName` and `email`. Address must include `country`. |
| `orderLines` | array | yes | Specifies the product purchased. Must include `quantity` and `productId`. |
If the request is successful, the response body includes the newly created subscription number. For an example of a full request body,
see the [Marketplace interactive API documentation](https://customers.staging.gitlab.com/openapi_docs/marketplace).
If the subscription creation is unsuccessful, the response body includes an error message with details about the cause of the error.