Payment Methods

Overview

The Payment Methods API allows you to manage payment options available in your Venddor store. This documentation covers how to retrieve, create, update, and manage payment processors and their configurations.

Base URL: https://www.venddor.com.br/api/2.0/payments

Available Payment Methods

Payment Method Code Description
Credit Card cc Process payments through major credit card networks. Supports multiple payment processors.
PayPal paypal Allow customers to pay using their PayPal account.
Bank Transfer bank Generate payment instructions for direct bank transfers.
Cash on Delivery cod Payment collected at the time of delivery.
PIX pix Instant payment system for Brazilian merchants.
Boleto boleto Brazilian payment slip system.

Common API Operations

GET /api/2.0/payments

Returns a list of all configured payment methods for the store.

GET /api/2.0/payments/{payment_id}

Returns details of a specific payment method configuration.

POST /api/2.0/payments

Creates a new payment method configuration.

PUT /api/2.0/payments/{payment_id}

Updates an existing payment method configuration.

DELETE /api/2.0/payments/{payment_id}

Disables a payment method.

Payment Method Configuration

When creating or updating a payment method, you'll need to provide configuration details. Here's an example of a credit card payment method configuration:

{
  "payment_id": "16",
  "processor": "stripe",
  "payment_category": "cc",     
  "company_id": "1",
  "position": 10,
  "status": "A",           // A - active, D - disabled
  "processor_params": {
    "api_key": "sk_test_abcdefghijklmnopqrstuvwxyz",
    "publishable_key": "pk_test_abcdefghijklmnopqrstuvwxyz",
    "test_mode": false,
    "payment_types": ["visa", "mastercard", "amex"]
  },
  "localization": {
    "payment_name": "Credit Card",
    "description": "Pay securely with your credit card",
    "instructions": "Enter your card details to complete the payment"
  },
  "surcharge": 0,
  "tax_ids": ["1", "2"],
  "min_order_amount": 5.00,
  "max_order_amount": null,
  "allowed_countries": ["BR", "US", "CA"]
}
Security Warning: Never expose your API keys or other sensitive payment credentials in client-side code. Always handle payment processing securely through your server.

Payment Processing Workflow

The typical payment processing workflow in Venddor involves:

  1. Payment Method Selection - Customer chooses a payment method during checkout
  2. Payment Data Collection - System collects required payment information
  3. Payment Processing - Payment is submitted to the payment processor
  4. Order Status Update - Order status is updated based on payment result
  5. Confirmation - Customer receives confirmation of payment
Note: Payment processors may have different integration requirements. Refer to the specific payment processor documentation for detailed implementation guidelines.

Best Practices

Tip: Use the surcharge parameter to add a fee for specific payment methods if needed. This can be useful for methods with higher processing costs.