Purchase Master High-Resolution Files (Metered Billing)

This endpoint purchases the processed files using Stripe metered billing.

POST https://platform.cryo-mix.com/api/api-checkout


Request Headers

Header Type Required Description
X-Api-Key string Yes Your client API key.
Session-Id string Yes The unique session identifier.
Source string Yes Must be set to Mastering API.

Request Body

Parameter Type Required Description
first_name string Yes The first name of the customer.
last_name string Yes The last name of the customer.
email string Yes The email of the customer.
marketing_consent boolean No Indicates if the customer has consented to marketing.

Example Request

{
  "first_name": "John",
  "last_name": "Doe",
  "email": "john.doe@example.com",
  "marketing_consent": true
}

Response

Success Response (200 OK)

{
  "status": "Api success, purchase successfully"
}

Error Responses

400 Bad Request

{
  "error": "First name, last name, and email are required"
}

Possible Causes:

• A required header (X-Api-Key, Session-Id, or Source) is missing or invalid.

• Required fields (first_name, last_name, email) are missing.

• The mastering process is not in the correct state for purchase (must be completed).

• The purchase has already been made.

• The metered billing subscription is not active.

401 Unauthorized

{
  "error": "invalid X-Api-Key"
}

Possible Causes:

• The API key is incorrect.

• The Source header is incorrect.

• The request is coming from a domain that is not on your list of allowed domains.

Usage Examples

JavaScript (Fetch)

const response = await fetch('https://platform.cryo-mix.com/api/api-checkout', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'your-api-key-here',
    'Session-Id': 'unique-session-id',
    'Source': 'Mastering API',
  },
  body: JSON.stringify({
    first_name: 'John',
    last_name: 'Doe',
    email: 'john.doe@example.com',
    marketing_consent: true
  })
});

const result = await response.json();
console.log(result.status);

cURL

curl -X POST https://platform.cryo-mix.com/api/api-checkout \
  -H "X-Api-Key: your-api-key-here" \
  -H "Session-Id: unique-session-id" \
  -H "Source: Mastering API" \
  -H "Origin: your-domain.com" \
  -d '{
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe@example.com",
    "marketing_consent": true
  }'

Prerequisites

Subscription Requirements

Before using this endpoint, please ensure you have an active metered billing subscription.

Note

• The Session-Id is the same identifier used when uploading the file.

• Use the Get Download Signed URL endpoint to get the purchased final files.