Link product variant with external variant ID
PUT/api/v1/sdk/products/:productId/variants/:variantId/link-external
This endpoint links an existing VesuvioPay product variant to an external variant ID from your platform. Useful when variants were created without external IDs.
Authentication: Requires Private API Key (sk_*)
Use Cases:
- Linking variants created manually in VesuvioPay to platform IDs
- Fixing missing external ID mappings for variants
- Enabling external ID-based operations for existing variants
- Migrating variants between platforms
Error Scenarios:
- 404 NOT FOUND - Product or variant not found (Error code: PRODUCT_NOT_FOUND or VARIANT_NOT_FOUND)
- 400 BAD REQUEST - Invalid request, variant doesn't belong to product, or external ID already in use (Error code: INVALID_REQUEST, VARIANT_MISMATCH, or EXTERNAL_ID_IN_USE)
- 401 UNAUTHORIZED - Invalid or missing API key (Error code: INVALID_API_KEY)
- 403 FORBIDDEN - API key doesn't have access to this store (Error code: NO_STORE_ACCESS)
Request​
Responses​
- 200
- 400
- 401
- 403
- 404
- 500
Variant linked successfully to external ID
Invalid request, variant mismatch, or external ID already in use
Unauthorized - Invalid or missing API key
Forbidden - No access to this store
Product or variant not found
Internal server error