🌟Best Practices Guide

πŸ’‘ Standards, formats, and recommendations for optimal API usage


🌐 Language Format Standards

Why Language Codes Matter

Using standardized language codes ensures your marketing campaigns reach customers in their preferred language, improving engagement and conversion rates. Proper language tagging also enables accurate analytics and segmentation across global markets.

IETF Language Tags (BCP 47)

We use the IETF BCP 47 international standard for language identification. This standard is used by HTML, HTTP, and most modern software systems, ensuring compatibility and consistency.

Format Pattern

language[-script][-region][-variant]

Common Examples

Language Tag
Description
Usage

en

English (generic)

Default English content

en-US

English (United States)

US-specific content

en-GB

English (United Kingdom)

UK-specific content

es

Spanish (generic)

Default Spanish content

es-ES

Spanish (Spain)

Spain-specific content

es-MX

Spanish (Mexico)

Mexico-specific content

fr

French (generic)

Default French content

fr-FR

French (France)

France-specific content

fr-CA

French (Canada)

Canadian French content

de

German (generic)

Default German content

de-DE

German (Germany)

Germany-specific content

de-AT

German (Austria)

Austria-specific content

pt

Portuguese (generic)

Default Portuguese content

pt-BR

Portuguese (Brazil)

Brazilian Portuguese

pt-PT

Portuguese (Portugal)

European Portuguese

it-IT

Italian (Italy)

Italian content

ja-JP

Japanese (Japan)

Japanese content

zh-CN

Chinese (Simplified, China)

Simplified Chinese

zh-TW

Chinese (Traditional, Taiwan)

Traditional Chinese

Best Practices for Language Tags

1. Be Consistent Use the same format throughout your system. If you use en-US in one place, don't use en or en-us elsewhere.

2. Start Simple Use basic language codes (en, de, fr) unless regional differences actually matter to your customers. For example:

  • Use en if content is the same for all English speakers

  • Use en-US vs en-GB only if spelling, dates, or terminology differ

3. Case Sensitivity Language codes are technically case-insensitive, but follow these conventions for clarity:

  • Lowercase for language: en (not EN)

  • Uppercase for region: US (not us)

  • Title case for script: Hans (not HANS)

4. Validate Before Sending Validate language tags client-side before API calls to avoid validation errors and ensure data quality.

Example Implementation


πŸ’° Currency Format Standards

Why Currency Codes Matter

Using standardized currency codes ensures accurate financial reporting, proper price display, and compliance with international commerce regulations. It also enables multi-currency analytics and prevents costly errors in pricing logic.

ISO 4217 Currency Codes

We require currency codes to follow the ISO 4217 international standard - the same standard used by banks, payment processors, and financial systems worldwide.

Format Requirements

Always use 3-letter alphabetic codes:

  • βœ… Correct: USD, EUR, GBP

  • ❌ Wrong: $, €, USD$, dollar

Uppercase letters only:

  • βœ… Correct: USD

  • ❌ Wrong: usd, Usd

No currency symbols:

  • βœ… Correct: USD, JPY

  • ❌ Wrong: $, Β₯

Common Currency Codes

Code
Currency
Country/Region

USD

US Dollar

United States

EUR

Euro

European Union

GBP

British Pound

United Kingdom

JPY

Japanese Yen

Japan

CHF

Swiss Franc

Switzerland

CAD

Canadian Dollar

Canada

AUD

Australian Dollar

Australia

NZD

New Zealand Dollar

New Zealand

CNY

Chinese Yuan

China

INR

Indian Rupee

India

KRW

South Korean Won

South Korea

SGD

Singapore Dollar

Singapore

HKD

Hong Kong Dollar

Hong Kong

MXN

Mexican Peso

Mexico

BRL

Brazilian Real

Brazil

SEK

Swedish Krona

Sweden

NOK

Norwegian Krone

Norway

DKK

Danish Krone

Denmark

PLN

Polish ZΕ‚oty

Poland

CZK

Czech Koruna

Czech Republic

HUF

Hungarian Forint

Hungary

RUB

Russian Ruble

Russia

ZAR

South African Rand

South Africa

TRY

Turkish Lira

Turkey

AED

UAE Dirham

United Arab Emirates

Best Practices for Currency Codes

  1. Consistency: Always use the same currency code format

  2. No Symbols: Never use currency symbols instead of codes

  3. Validation: Validate currency codes before submission

  4. Price Handling: Store prices as decimals with appropriate precision

Example Implementation


πŸ“Š Data Quality Best Practices

1. Batch Processing

Entity Type
Recommended Size
Maximum Size

Customers

100-500

1000

Orders

50-200

500

Products

50-100

200

Why Batch Sizes Matter

  • Performance: Larger batches reduce API calls but increase processing time

  • Error Handling: Smaller batches make error isolation easier

  • Memory Usage: Large batches consume more memory on both client and server

2. Data Validation

Pre-submission Validation Checklist

βœ… Required Fields

  • Ensure all required fields are present

  • Check for null vs empty string distinctions

βœ… String Lengths

  • Validate against maximum length constraints

  • Truncate if necessary (with warnings)

βœ… Data Types

  • Verify correct data types (numbers, booleans, dates)

  • Ensure proper date formatting (ISO 8601)

βœ… Business Rules

  • Validate email formats

  • Check phone number patterns

  • Ensure price consistency

3. Error Handling Strategy

4. Identifier Management

Customer Identifiers

Product Identifiers


πŸ”’ Security Best Practices

1. API Key Management

  • Store Securely: Never commit API keys to version control

  • Rotate Regularly: Change API keys periodically

  • Limit Scope: Use different keys for different environments

  • Monitor Usage: Track API key usage for anomalies

2. Data Privacy

  • GDPR Compliance: Always obtain proper consent

  • Data Minimization: Only send necessary data

  • Anonymization: Remove PII when not needed

  • Audit Trail: Log data access and modifications

3. Rate Limiting


πŸš€ Performance Optimization

1. Compression

  • Enable gzip compression for requests and responses

  • Expect 60-80% size reduction for JSON payloads

2. Connection Pooling

  • Reuse HTTP connections

  • Configure appropriate timeout values

  • Monitor connection pool health

3. Async Processing


πŸ“‹ Checklist for Implementation

Initial Setup

Data Preparation

Testing

Production


πŸ”— References

Standards Documentation

External Resources

Last updated