Skip to main content

Orders API Overview

What is the Orders API?

The Orders API enables you to manage customer purchases and access permissions for products on your Publica.la platform. It supports creating, retrieving, updating, and canceling orders programmatically.

Authentication Required

Make sure you have generated an API token in your store dashboard. See the API Authentication guide for details.

Available Order Types

The Orders API supports three distinct order types, each designed for specific integration scenarios:

Order TypeUse CasePayment RecordInitial StatusBest For
PermissionGrant content accessNo payment record createdapprovedOwn e-commerce integrations, legacy permissions migration
ReportAssign content + record paymentPayment record created in Publica.laapprovedOwn e-commerce integrations, External Marketplace sales
SalePublica.la checkout flowPayment processed via gatewaypendingDirect sales through Publica.la initiated from outside

Choosing the Right Order Type

Use Permission Orders when:

  • You process payments in your own e-commerce

    • You collect payment in your system
    • You want to use Publica.la only for content delivery
    • No financial record needed in Publica.la
  • Want to migrate legacy from a previous system to Publica.la or grant free access

    • Migrating legacy access from previous implementations
    • Manual content assignments

Use Report Orders when:

  • Recording sales with financial tracking

    • Need to track sales in Publica.la's financial system
    • Creating payment records for accounting/reporting
    • Can also be used for your own content if you need financial tracking
  • Granting access to Publica.la's marketplace content

    • You collected payment in your system but want to grant access to marketplace content (requires support enablement)
Marketplace Content

Report orders are primarily used for marketplace content (content you don't own). Contact support to enable marketplace content sales. You can also use Report for your own content if you need financial records in Publica.la.

Use Sale Orders when:

  • Using Publica.la's checkout system
    • Customer pays directly through Publica.la
    • Payment processed via Stripe or MercadoPago
    • Full payment gateway integration needed
    • Automatic payment status updates

Example scenarios:

  • "Your own e-commerce site with 'Buy Now' button redirecting to Publica.la"
  • "You don't want to handle payments"

Common API Operations

Core Endpoints

OperationEndpointSupported Types
Create orderPOST /integration-api/v1/ordersAll types
List ordersGET /integration-api/v1/ordersAll types
Get specific orderGET /integration-api/v1/orders/{id}All types
Update orderPUT /integration-api/v1/orders/{id}All types
Cancel orderDELETE /integration-api/v1/orders/{id}All types

Order Identification

Orders can be identified using either:

  • Internal ID: Publica.la's UUID (e.g., ?id_type=internal)
  • External Reference: Your system's ID (e.g., ?id_type=external)

Order Lifecycle

Permission Order:  [Create] → approved ✓
Report Order: [Create] → approved ✓
Sale Order: [Create] → pending → [User Pays] → approved ✓

All order types support these status transitions:

  • approvedpaused or cancelled
  • pausedapproved or cancelled
  • cancelled is final (no further changes)

Resource Auto-Creation

The Orders API automatically creates resources when they don't exist:

Users

If a user.id doesn't exist, a new user is created with:

  • The provided user.id (your system's external ID)
  • The provided user.email

Products (Sale orders only)

For sale type orders, if a product doesn't exist and you provide:

  • products.*.name
  • products.*.url

A new product of type 'link' will be created automatically.

Next Steps

Choose the order type that fits your integration:

Common Response Format

All order types return responses with these common fields:

FieldTypeDescription
idstringPublica.la's unique order ID (UUID)
external_referencestringYour unique ID for this order
typestringOrder type: permission, report, or sale
statusstringOrder status: approved, pending, paused, or cancelled
userobjectUser information
productsarrayProducts included in the order
created_atstringCreation timestamp

See individual order type documentation for complete field reference.

X

Graph View