> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cheqpay.mx/llms.txt
> Use this file to discover all available pages before exploring further.

# Going Live

> Complete checklist for launching in production

## Production Readiness

Ready to go live? Follow this comprehensive checklist to ensure a smooth launch.

## Pre-Launch Checklist

### 1. Complete Testing

<AccordionGroup>
  <Accordion title="Payment Processing" icon="credit-card">
    * ✅ Successful card payments (Visa, Mastercard, Amex)
    * ✅ Declined payment handling
    * ✅ 3D Secure authentication flow
    * ✅ Saved payment method usage
  </Accordion>

  <Accordion title="Refund Processing" icon="rotate-left">
    * ✅ Full refunds
    * ✅ Partial refunds
    * ✅ Multiple partial refunds
    * ✅ Refund notification workflow
  </Accordion>

  <Accordion title="Error Handling" icon="triangle-exclamation">
    * ✅ Network errors
    * ✅ Validation errors
    * ✅ Declined payments
    * ✅ 3DS authentication failures
    * ✅ Timeout scenarios
  </Accordion>
</AccordionGroup>

### 2. Get Production Credentials

<Steps>
  <Step title="Contact Support">
    Email [support@cheqpay.mx](mailto:support@cheqpay.mx) to request production API keys.
  </Step>

  <Step title="Complete Verification">
    Provide required business documentation and complete KYC verification.
  </Step>

  <Step title="Receive Credentials">
    You'll receive your production API key securely.
  </Step>

  <Step title="Store Securely">
    Add credentials to your environment variables, never hardcode them.
  </Step>
</Steps>

### 3. Update Configuration

#### Change Base URL

```javascript theme={null}
// Before (Sandbox)
const baseUrl = 'https://api.sandbox.cheqpay.mx/pos';
const apiKey = process.env.CHEQPAY_SANDBOX_KEY;

// After (Production)
const baseUrl = 'https://prod.cheqpay.mx/pos';
const apiKey = process.env.CHEQPAY_PRODUCTION_KEY;
```

#### Environment-Based Config

```javascript theme={null}
const config = {
  sandbox: {
    baseUrl: 'https://api.sandbox.cheqpay.mx/pos',
    apiKey: process.env.CHEQPAY_SANDBOX_KEY
  },
  production: {
    baseUrl: 'https://prod.cheqpay.mx/pos',
    apiKey: process.env.CHEQPAY_PRODUCTION_KEY
  }
};

const env = process.env.NODE_ENV || 'sandbox';
module.exports = config[env];
```

### 5. Security Review

<CardGroup cols={2}>
  <Card title="API Keys" icon="key">
    * Stored in environment variables
    * Not committed to version control
    * Different keys for each environment
    * Rotation schedule defined
  </Card>

  <Card title="Data Protection" icon="shield">
    * No card numbers logged
    * No CVCs stored
    * HTTPS on all payment pages
  </Card>

  <Card title="PCI Compliance" icon="certificate">
    * Using Cheqpay tokenization
    * No card data on your servers
    * SAQ-A compliance maintained
  </Card>

  <Card title="Access Control" icon="lock">
    * API keys restricted to production
    * Team access properly managed
    * Audit logs enabled
  </Card>
</CardGroup>

### 6. Monitoring Setup

#### Log Important Events

```javascript theme={null}
logger.info('payment.created', {
  externalId: payment.externalId,
  amount: payment.amount,
  status: payment.status,
  timestamp: new Date().toISOString()
});
```

#### Set Up Alerts

```javascript theme={null}
// Alert on high failure rate
if (failureRate > 0.15) {
  alert('High payment failure rate detected');
}

// Alert on API errors
if (apiErrorRate > 0.01) {
  alert('Elevated API error rate');
}
```

#### Monitor Key Metrics

* Payment success rate
* Average payment amount
* Decline rate by card type
* 3DS challenge rate
* Refund rate

### 7. Customer Communication

<AccordionGroup>
  <Accordion title="Payment Confirmations" icon="envelope">
    Set up email confirmations for:

    * Successful payments
    * Failed payments
    * Refund notifications
  </Accordion>

  <Accordion title="Support Information" icon="headset">
    Provide clear support contact information:

    * Email support
    * Phone number (if available)
    * FAQ or help center
    * Expected response time
  </Accordion>

  <Accordion title="Refund Policy" icon="file-contract">
    Clearly communicate:

    * Refund eligibility
    * Refund timeline (5-10 days for cards)
    * How to request refunds
    * Processing fee policy
  </Accordion>
</AccordionGroup>

## Launch Day

### Step 1: Final Verification

<Steps>
  <Step title="Review Configuration">
    Double-check all production credentials and URLs are correct.
  </Step>

  <Step title="Test Small Transaction">
    Process a small test payment in production (e.g., \$1.00 MXN).
  </Step>

  <Step title="Test Refund">
    Issue a refund on the test payment to verify refund flow.
  </Step>
</Steps>

### Step 2: Gradual Rollout

```javascript theme={null}
// Start with percentage-based rollout
const useNewPaymentGateway = Math.random() < 0.1;  // 10% of traffic

if (useNewPaymentGateway) {
  // Use Cheqpay
  return await cheqpay.payments.create(paymentData);
} else {
  // Use old payment method
  return await legacyPayments.create(paymentData);
}
```

### Step 3: Monitor Closely

Watch for:

* Payment success rates
* Error rates
* Customer feedback
* Support tickets

### Step 4: Increase Traffic

Gradually increase rollout percentage:

* Day 1: 10%
* Day 2: 25%
* Day 3: 50%
* Day 5: 100%

## Post-Launch

### Week 1: Close Monitoring

<CardGroup cols={2}>
  <Card title="Daily Checks" icon="calendar-day">
    * Review payment metrics
    * Check error logs
    * Read customer feedback
  </Card>

  <Card title="Performance Review" icon="chart-line">
    * Success rate vs sandbox
    * Decline rate analysis
    * 3DS challenge rate
    * Average processing time
  </Card>
</CardGroup>

### Ongoing Maintenance

<AccordionGroup>
  <Accordion title="Regular Reviews" icon="calendar-check">
    * Weekly: Review metrics and error rates
    * Monthly: Analyze trends and patterns
    * Quarterly: Review and rotate API keys
  </Accordion>

  <Accordion title="Keep Updated" icon="newspaper">
    * Subscribe to Cheqpay status updates
    * Join developer community
    * Read API changelog
    * Test new features in sandbox
  </Accordion>

  <Accordion title="Optimize Continuously" icon="arrows-rotate">
    * A/B test payment flows
    * Reduce friction points
    * Improve error messages
    * Update saved card prompts
  </Accordion>
</AccordionGroup>

## Common Issues

### Issue: Higher Decline Rate in Production

**Possible Causes:**

* Missing device information
* Inconsistent customer data
* Missing billing address
* New merchant risk profile

**Solutions:**

* Include complete device information
* Always send billing address
* Use saved cards for returning customers
* Contact support for merchant review

### Issue: 3DS Challenges Too Frequent

**Solutions:**

* Include device fingerprinting
* Send consistent customer data
* Use saved payment methods
* Include billing address
* Contact support to review risk profile

## Rollback Plan

If you need to rollback:

```javascript theme={null}
// Quick rollback to legacy system
const USE_CHEQPAY = process.env.USE_CHEQPAY === 'true';

if (USE_CHEQPAY) {
  return await cheqpay.payments.create(paymentData);
} else {
  return await legacyPayments.create(paymentData);
}
```

Set environment variable to disable:

```bash theme={null}
USE_CHEQPAY=false
```

## Support

Need help going live?

<CardGroup cols={2}>
  <Card title="Email Support" icon="envelope" href="mailto:support@cheqpay.mx">
    Get help from our integration team
  </Card>

  <Card title="Developer Slack" icon="slack">
    Join our developer community (contact support for invite)
  </Card>

  <Card title="Status Page" icon="signal" href="https://status.cheqpay.com">
    Monitor API status and incidents
  </Card>

  <Card title="Documentation" icon="book" href="/">
    Review complete documentation
  </Card>
</CardGroup>

## Success Checklist

Before considering your launch complete:

* ✅ Production credentials obtained and configured
* ✅ Base URL updated to production
* ✅ Test transaction processed successfully
* ✅ Monitoring and alerts configured
* ✅ Error handling tested
* ✅ Customer communications set up
* ✅ Support team trained
* ✅ Rollback plan documented
* ✅ Success metrics defined
* ✅ Gradual rollout completed
* ✅ Performance metrics reviewed

## Next Steps

<CardGroup cols={2}>
  <Card title="Testing Guide" icon="flask" href="/guides/testing">
    Review complete testing scenarios
  </Card>

  <Card title="Best Practices" icon="lightbulb" href="/guides/best-practices">
    Follow recommended patterns
  </Card>

  <Card title="Error Handling" icon="triangle-exclamation" href="/guides/error-handling">
    Handle production errors
  </Card>

  <Card title="API Reference" icon="book" href="/api-reference/introduction">
    Complete API documentation
  </Card>
</CardGroup>

***

**Congratulations on going live with Cheqpay!** 🎉

We're here to support you every step of the way. Contact us anytime at [support@cheqpay.mx](mailto:support@cheqpay.mx).
