{{ translate('Purchase Validation') }}

{{ translate('Validate a purchase code and returns details about the purchase if valid.') }}

{{ translate('Endpoint') }}

{{ translate('POST') }}
{{ route('api.purchases.validation') }}

{{ translate('Parameters') }}

{{ translate('Responses') }}

{{ translate('Success Response') }}:

{
    "status": "{{ translate('success') }}",
    "data": {
        "purchase": {
            "purchase_code": "abcdefghijklmnopqrstuvwxyz123456789",
            "license_type": "{{ translate('Regular') }}",
            "price": 19.99,
            "currency": "{{ defaultCurrency()->code }}",
            "item": {
                "id": 1,
                "name": "Sample Item",
                "description": "This is a sample item",
                "category": "Category Name",
                "sub_category": "Subcategory Name",
                "options": ["option1", "option2"],
                "version": 1.0.0,
                "demo_link": "https://example.com/demo",
                "tags": ["tag1", "tag2"],
                "media": {
                    "thumbnail": "https://example.com/thumbnail.png",
                    "preview_image": "https://example.com/preview.jpg", // {{ translate('This is not included for audio items') }}
                    "preview_video": "https://example.com/video.mp4", // {{ translate('This is only included for video items') }}
                    "preview_audio": "https://example.com/audio.mp3", // {{ translate('This is only included for audio items') }}
                    "screenshots": [ {{ translate('This is only included if item has screenshots') }}
                        "https://example.com/screenshot1.jpg",
                        "https://example.com/screenshot2.jpg"
                    ],
                },
                "price": {
                    "regular": 19.99,
                    "extended": 29.99
                },
                "currency": "{{ defaultCurrency()->code }}",
                "published_at": "2024-04-27T12:00:00Z"
            },
            "supported_until": "2024-04-27T12:00:00Z", // {{ translate('This will not exist if support is disabled or its not supported') }}
            "downloaded": false,
            "date": "2024-04-27T12:00:00Z"
        }
    }
}

{{ translate('Error Response') }}:

{
    "status": "{{ translate('error') }}",
    "msg": "{{ translate('Invalid purchase code') }}"
}