Endpoint#
POST /api/checkout/pro
Creates an Airwallex hosted checkout for Pro (x-api-tiers lists its limits and price) and, with Accept: application/json, returns {checkout: true, url} for a person to open and pay. Without that Accept header it answers 303 to the hosted page. Pay with the address a key was emailed to and that key moves to Pro. Answers 200 {checkout: false} while checkout is not open. Nothing is charged until the hosted checkout is completed. People can use https://china-snapshot.com/api#upgrade instead.
Authentication#
[]An empty security requirement means this operation does not declare authentication. Read operation notes for entitlement and protocol-method requirements.
Parameters#
No parameters declared by the specification.
Request body#
{
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"required": [
"email"
],
"properties": {
"email": {
"type": "string",
"format": "email",
"maxLength": 254
}
}
}
}
}
}Responses and errors#
| HTTP status | Meaning |
|---|---|
| 200 | {checkout: true, url} with the hosted checkout URL, or {checkout: false, message} when checkout is not open. |
| 303 | Redirect to the hosted checkout (no Accept: application/json). |
| 400 | No usable email. |
| 429 | Rate limit exceeded; honour Retry-After. |
| 502 | The checkout could not be started; nothing was charged. |
Response examples#
No response example is supplied by OpenAPI for this operation. The complete response schemas are preserved below; use an actual response for observed values.
Retry guidance#
See errors and retries. Honor operation-specific response headers. A POST may create state; do not replay it automatically.
Complete operation contract#
The expanded contract below includes all parameter constraints, response headers, schemas and examples from OpenAPI.
{
"path": "/api/checkout/pro",
"method": "POST",
"parameters": [],
"operationId": "startProCheckout",
"summary": "Start the Pro subscription checkout",
"description": "Creates an Airwallex hosted checkout for Pro (x-api-tiers lists its limits and price) and, with Accept: application/json, returns {checkout: true, url} for a person to open and pay. Without that Accept header it answers 303 to the hosted page. Pay with the address a key was emailed to and that key moves to Pro. Answers 200 {checkout: false} while checkout is not open. Nothing is charged until the hosted checkout is completed. People can use https://china-snapshot.com/api#upgrade instead.",
"tags": [
"keys",
"Manage access"
],
"security": [],
"requestBody": {
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"required": [
"email"
],
"properties": {
"email": {
"type": "string",
"format": "email",
"maxLength": 254
}
}
}
}
}
},
"responses": {
"200": {
"description": "{checkout: true, url} with the hosted checkout URL, or {checkout: false, message} when checkout is not open.",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"checkout"
],
"properties": {
"checkout": {
"type": "boolean"
},
"url": {
"type": "string",
"format": "uri"
},
"message": {
"type": "string"
}
}
}
}
}
},
"303": {
"description": "Redirect to the hosted checkout (no Accept: application/json)."
},
"400": {
"description": "No usable email."
},
"429": {
"description": "Rate limit exceeded; honour Retry-After."
},
"502": {
"description": "The checkout could not be started; nothing was charged."
}
},
"x-codeSamples": [
{
"lang": "curl",
"label": "curl",
"source": "curl -s -X POST 'https://china-snapshot.com/api/checkout/pro' \\\n -H 'Accept: application/json' \\\n -d 'email=you@example.com'"
}
]
}