# createCreditCheckout

```graphql
mutation CreateCreditCheckout($input: CreditCheckoutInput!) {
  createCreditCheckout(input: $input) {
    status
    checkoutUrl
  }
}
```

Start a Stripe checkout to buy a credit package for an account, or for the account that owns a project; returns the checkout URL. Requires account.billing.manage.

## Arguments

| Name                     | Type                 | Required | Description                                                                                                                                             |
| ------------------------ | -------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `input`                  | CreditCheckoutInput! | Yes      |                                                                                                                                                         |
| `input.packageId`        | String!              | Yes      |                                                                                                                                                         |
| `input.projectReference` | String               |          | Project UUID or slug for an owner-pays top-up: the project owner’s wallet and effective price apply. Naming a project also requires project.read on it. |
| `input.successUrl`       | String               |          |                                                                                                                                                         |
| `input.cancelUrl`        | String               |          |                                                                                                                                                         |

## Variables

```json
{
  "input": {
    "packageId": "small"
  }
}
```

## Responses

| Status | Description                                       |
| ------ | ------------------------------------------------- |
| 200    | The CreditCheckout! in data.createCreditCheckout. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "mutation CreateCreditCheckout($input: CreditCheckoutInput!) {\n  createCreditCheckout(input: $input) {\n    status\n    checkoutUrl\n  }\n}",
  "variables": {
    "input": {
      "packageId": "small"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "createCreditCheckout": {
      "status": "string",
      "checkoutUrl": "https://example.com"
    }
  }
}
```
