{"components":{"securitySchemes":{"FlyBearerAuth":{"description":"A Fly API token with access to the requested organization. No account yet? Run `fly auth signup`, then `fly tokens create org -o <org> --expiry 1h`.","scheme":"bearer","type":"http"}}},"info":{"title":"Fly.io MPP credits API","version":"1.0"},"openapi":"3.1.0","paths":{"/api/v1/mpp/credits":{"post":{"callbacks":{},"description":"Buy Fly.io credits for an org with the Machine Payments Protocol (https://mpp.dev), paid with a Stripe shared payment token, for example from Link. With a Fly API token, the answer is a 402 challenge for `amount` (10 dollars when it is not set); the retry with the credential in `Payment-Authorization` adds the credit. The org needs a card on file.","operationId":"MppCredits_buy","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"amount":{"default":"10","description":"Dollars of credit.","enum":["5","10","25","50","100"],"type":"string"},"org_slug":{"description":"The org that gets the credit: its slug, or `personal` for your personal org.","type":"string"}},"required":["org_slug"],"type":"object"}}},"description":"The purchase","required":true},"responses":{"200":{"description":"Paid. The credit is added, or pending while the payment settles."},"400":{"description":"`org_slug` is missing or isn't a string, or `amount` isn't one of the amounts."},"401":{"description":"A payment credential with no Fly API token. Send the token in Authorization."},"402":{"description":"Payment Required. `WWW-Authenticate: Payment` carries the challenge. Without a Fly API token it is a price quote: send the token to get a challenge you can pay."},"403":{"description":"The org can't buy credits this way; it needs a card on file."},"404":{"description":"No such org for this token, or MPP is off for the org."},"429":{"description":"Too many requests. Wait `Retry-After` seconds, then try again. Don't pay again."},"500":{"description":"Fly.io could not confirm the payment. Don't pay again."}},"security":[{"FlyBearerAuth":[]}],"summary":"Buy credits for an org with MPP","tags":[],"x-payment-info":{"offers":[{"amount":"500","currency":"usd","description":"Add $5 of credit to a Fly.io org","intent":"charge","method":"stripe"},{"amount":"1000","currency":"usd","description":"Add $10 of credit to a Fly.io org","intent":"charge","method":"stripe"},{"amount":"2500","currency":"usd","description":"Add $25 of credit to a Fly.io org","intent":"charge","method":"stripe"},{"amount":"5000","currency":"usd","description":"Add $50 of credit to a Fly.io org","intent":"charge","method":"stripe"},{"amount":"10000","currency":"usd","description":"Add $100 of credit to a Fly.io org","intent":"charge","method":"stripe"}]}}}},"security":[],"servers":[{"url":"https://fly.io"}],"tags":[]}