Limbus Pay API v0.1.0

Payment orchestration SaaS — shops, sessions, providers, rotations.

The Limbus Pay API gives programmatic access to payment session state, rotation rules, provider connections, and the tenant audit log. Writes are applied on the writer daemon side; this public API is read-first in v0.1 and will gain write endpoints as those server-side purposes land.

Keys begin with `pay_live_` (real money) or `pay_test_` (test environment, separate data, no settlement). Pass them in `Authorization: Bearer`.

Endpoints

Tenant

GET /v1/tenant Get the tenant tenant:read

Responses

200 — The tenant.

{
    "type": "object",
    "properties": {
        "id": {
            "type": "string"
        },
        "email": {
            "type": "string"
        },
        "plan": {
            "type": "string"
        },
        "balance_usd": {
            "type": "string"
        },
        "frozen": {
            "type": "boolean"
        },
        "email_verified": {
            "type": "boolean"
        },
        "twofa_enabled": {
            "type": "boolean"
        },
        "trial_until": {
            "type": "string",
            "nullable": true
        },
        "environment": {
            "type": "string",
            "enum": [
                "live",
                "test"
            ]
        },
        "limits": {
            "type": "object",
            "properties": {
                "monthly_sessions": {
                    "type": "integer"
                },
                "failover_rules": {
                    "type": "integer"
                }
            }
        }
    }
}

Shops

GET /v1/shops List shops shops:read

Parameters

InNameRequiredShape
querylimit{"type":"integer","minimum":1,"maximum":100,"default":20}
querystarting_after{"type":"string"}

Responses

200 — Shops of the tenant.

{
    "type": "object",
    "properties": {
        "object": {
            "type": "string",
            "const": "list"
        },
        "has_more": {
            "type": "boolean"
        },
        "data": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "object": {
                        "type": "string",
                        "const": "shop"
                    },
                    "id": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string"
                    },
                    "currency": {
                        "type": "string"
                    },
                    "webhook_url": {
                        "type": "string"
                    },
                    "key_version": {
                        "type": "string"
                    },
                    "hmac_rotation_pending": {
                        "type": "boolean"
                    },
                    "business_descriptor": {
                        "type": "string"
                    },
                    "give_up_fast_window_sec": {
                        "type": "integer"
                    }
                }
            }
        }
    }
}
POST /v1/shops Create a shop shops:write

Parameters

InNameRequiredShape
headerIdempotency-Key{"type":"string","minLength":1,"maxLength":128,"pattern":"^[\\x20-\\x7e]+$"}

Request body (application/json, required)

{
    "type": "object",
    "required": [
        "slug",
        "url",
        "currency",
        "webhook_url"
    ],
    "properties": {
        "slug": {
            "type": "string",
            "pattern": "^[a-z0-9_]{1,48}$"
        },
        "url": {
            "type": "string",
            "maxLength": 255
        },
        "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
        },
        "webhook_url": {
            "type": "string",
            "maxLength": 512,
            "pattern": "^https://"
        },
        "business_descriptor": {
            "type": "string",
            "maxLength": 80
        }
    }
}

Responses

201 — One shop.

{
    "type": "object",
    "properties": {
        "object": {
            "type": "string",
            "const": "shop"
        },
        "id": {
            "type": "string"
        },
        "slug": {
            "type": "string"
        },
        "url": {
            "type": "string"
        },
        "currency": {
            "type": "string"
        },
        "webhook_url": {
            "type": "string"
        },
        "key_version": {
            "type": "string"
        },
        "hmac_rotation_pending": {
            "type": "boolean"
        },
        "business_descriptor": {
            "type": "string"
        },
        "give_up_fast_window_sec": {
            "type": "integer"
        }
    }
}
GET /v1/shops/{id} Get a shop shops:read

Parameters

InNameRequiredShape
pathidyes{"type":"string","pattern":"^s_[A-Za-z0-9]{22}$"}

Responses

200 — One shop.

{
    "type": "object",
    "properties": {
        "object": {
            "type": "string",
            "const": "shop"
        },
        "id": {
            "type": "string"
        },
        "slug": {
            "type": "string"
        },
        "url": {
            "type": "string"
        },
        "currency": {
            "type": "string"
        },
        "webhook_url": {
            "type": "string"
        },
        "key_version": {
            "type": "string"
        },
        "hmac_rotation_pending": {
            "type": "boolean"
        },
        "business_descriptor": {
            "type": "string"
        },
        "give_up_fast_window_sec": {
            "type": "integer"
        }
    }
}

Rotations

GET /v1/shops/{id}/rotation Get the rotation for a shop rotations:read

Parameters

InNameRequiredShape
pathidyes{"type":"string","pattern":"^s_[A-Za-z0-9]{22}$"}

Responses

200 — Rotation rules for a shop.

{
    "type": "object",
    "properties": {
        "object": {
            "type": "string",
            "const": "rotation"
        },
        "shop_id": {
            "type": "string"
        },
        "mode": {
            "type": "string",
            "enum": [
                "shop_driven",
                "percentage",
                "priority_limit"
            ],
            "nullable": true
        },
        "config": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
        },
        "updated_at": {
            "type": "string",
            "nullable": true
        }
    }
}
PUT /v1/shops/{id}/rotation Upsert the rotation for a shop rotations:write

Parameters

InNameRequiredShape
pathidyes{"type":"string","pattern":"^s_[A-Za-z0-9]{22}$"}
headerIdempotency-Key{"type":"string","minLength":1,"maxLength":128,"pattern":"^[\\x20-\\x7e]+$"}

Request body (application/json, required)

{
    "type": "object",
    "required": [
        "mode"
    ],
    "properties": {
        "mode": {
            "type": "string",
            "enum": [
                "shop_driven",
                "percentage",
                "priority_limit"
            ]
        },
        "config": {
            "type": "object",
            "description": "Mode-specific config. percentage \u2192 {splits: [{credential_pair_id, percentage}]} with percentages summing to 100. priority_limit \u2192 {rules: [{credential_pair_id, priority, daily_cap_usd?}]}. shop_driven \u2192 whatever the shop passes.",
            "additionalProperties": true
        }
    }
}

Responses

200 — Rotation rules for a shop.

{
    "type": "object",
    "properties": {
        "object": {
            "type": "string",
            "const": "rotation"
        },
        "shop_id": {
            "type": "string"
        },
        "mode": {
            "type": "string",
            "enum": [
                "shop_driven",
                "percentage",
                "priority_limit"
            ],
            "nullable": true
        },
        "config": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true
        },
        "updated_at": {
            "type": "string",
            "nullable": true
        }
    }
}

Sessions

GET /v1/sessions List payment sessions sessions:read

Parameters

InNameRequiredShape
querylimit{"type":"integer","minimum":1,"maximum":100,"default":20}
querystarting_after{"type":"string"}
queryshop_id{"type":"string","pattern":"^s_[A-Za-z0-9]{22}$"}
querystatus{"type":"string","enum":["created","pending","paid","partially_paid","partially_paid_finalized","cancelled","failed","refunded","disputed","expired","quarantine"]}

Responses

200 — Payment sessions.

{
    "type": "object",
    "properties": {
        "object": {
            "type": "string",
            "const": "list"
        },
        "has_more": {
            "type": "boolean"
        },
        "data": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "object": {
                        "type": "string",
                        "const": "payment_session"
                    },
                    "id": {
                        "type": "string"
                    },
                    "shop_id": {
                        "type": "string"
                    },
                    "shop_order_id": {
                        "type": "string"
                    },
                    "provider": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "shop_amount": {
                        "type": "string"
                    },
                    "shop_currency": {
                        "type": "string"
                    },
                    "provider_amount": {
                        "type": "string"
                    },
                    "provider_currency": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    },
                    "events": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "type": {
                                    "type": "string"
                                },
                                "at": {
                                    "type": "string"
                                },
                                "payload": []
                            }
                        }
                    }
                }
            }
        }
    }
}
GET /v1/sessions/{id} Get a payment session sessions:read

Parameters

InNameRequiredShape
pathidyes{"type":"string","pattern":"^ps_[A-Za-z0-9]{22}$"}

Responses

200 — One payment session with its event timeline.

{
    "type": "object",
    "properties": {
        "object": {
            "type": "string",
            "const": "payment_session"
        },
        "id": {
            "type": "string"
        },
        "shop_id": {
            "type": "string"
        },
        "shop_order_id": {
            "type": "string"
        },
        "provider": {
            "type": "string"
        },
        "status": {
            "type": "string"
        },
        "shop_amount": {
            "type": "string"
        },
        "shop_currency": {
            "type": "string"
        },
        "provider_amount": {
            "type": "string"
        },
        "provider_currency": {
            "type": "string"
        },
        "description": {
            "type": "string",
            "nullable": true
        },
        "created_at": {
            "type": "string"
        },
        "updated_at": {
            "type": "string"
        },
        "events": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "type": {
                        "type": "string"
                    },
                    "at": {
                        "type": "string"
                    },
                    "payload": []
                }
            }
        }
    }
}

Providers

GET /v1/providers List connected providers providers:read

Responses

200 — Provider connections.

{
    "type": "object",
    "properties": {
        "object": {
            "type": "string",
            "const": "list"
        },
        "data": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "object": {
                        "type": "string",
                        "const": "provider_connection"
                    },
                    "id": {
                        "type": "string"
                    },
                    "provider": {
                        "type": "string"
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "active_pairs": {
                        "type": "integer"
                    }
                }
            }
        }
    }
}

Webhooks

GET /v1/webhooks List webhook deliveries webhooks:read

Parameters

InNameRequiredShape
querylimit{"type":"integer","minimum":1,"maximum":100,"default":20}
querystarting_after{"type":"string"}
queryshop_id{"type":"string","pattern":"^s_[A-Za-z0-9]{22}$"}

Responses

200 — Outgoing webhook delivery queue.

{
    "type": "object",
    "properties": {
        "object": {
            "type": "string",
            "const": "list"
        },
        "has_more": {
            "type": "boolean"
        },
        "data": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "object": {
                        "type": "string",
                        "const": "webhook_delivery"
                    },
                    "id": {
                        "type": "string"
                    },
                    "shop_id": {
                        "type": "string"
                    },
                    "session_id": {
                        "type": "string"
                    },
                    "event_type": {
                        "type": "string"
                    },
                    "attempts": {
                        "type": "integer"
                    },
                    "last_attempt_at": {
                        "type": "string",
                        "nullable": true
                    },
                    "last_status": {
                        "type": "string",
                        "nullable": true
                    },
                    "next_attempt_at": {
                        "type": "string",
                        "nullable": true
                    },
                    "delivered_at": {
                        "type": "string",
                        "nullable": true
                    }
                }
            }
        }
    }
}

Events

GET /v1/events List audit events events:read

Parameters

InNameRequiredShape
querylimit{"type":"integer","minimum":1,"maximum":100,"default":20}
querystarting_after{"type":"string"}
querytype{"type":"string"}

Responses

200 — Tenant audit events.

{
    "type": "object",
    "properties": {
        "object": {
            "type": "string",
            "const": "list"
        },
        "has_more": {
            "type": "boolean"
        },
        "data": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "object": {
                        "type": "string",
                        "const": "event"
                    },
                    "seq": {
                        "type": "integer"
                    },
                    "type": {
                        "type": "string"
                    },
                    "at": {
                        "type": "string"
                    },
                    "actor_kind": {
                        "type": "string"
                    },
                    "subject_kind": {
                        "type": "string"
                    },
                    "subject_id": {
                        "type": "string",
                        "nullable": true
                    },
                    "payload": []
                }
            }
        }
    }
}

Account

GET /v1/account/keys List API keys account:keys:read

Responses

200 — API keys of the tenant (never their plaintext).

{
    "type": "object",
    "properties": {
        "object": {
            "type": "string",
            "const": "list"
        },
        "data": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "object": {
                        "type": "string",
                        "const": "api_key"
                    },
                    "id": {
                        "type": "string",
                        "pattern": "^k_[A-Za-z0-9]{22}$"
                    },
                    "env": {
                        "type": "string",
                        "enum": [
                            "live",
                            "test"
                        ]
                    },
                    "prefix": {
                        "type": "string",
                        "maxLength": 16
                    },
                    "scopes": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "name": {
                        "type": "string",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "last_used_at": {
                        "type": "string",
                        "nullable": true
                    },
                    "revoked_at": {
                        "type": "string",
                        "nullable": true
                    }
                }
            }
        }
    }
}
POST /v1/account/keys Create an API key account:keys:write

Parameters

InNameRequiredShape
headerIdempotency-Key{"type":"string","minLength":1,"maxLength":128,"pattern":"^[\\x20-\\x7e]+$"}

Request body (application/json, required)

{
    "type": "object",
    "properties": {
        "env": {
            "type": "string",
            "enum": [
                "live",
                "test"
            ],
            "description": "Defaults to the env of the key making the request."
        },
        "name": {
            "type": "string",
            "maxLength": 60
        },
        "scopes": {
            "type": "array",
            "items": {
                "type": "string"
            },
            "default": [
                "*"
            ]
        }
    }
}

Responses

201 — The newly created key. `secret` is shown ONCE.

{
    "type": "object",
    "properties": {
        "object": {
            "type": "string",
            "const": "api_key"
        },
        "id": {
            "type": "string"
        },
        "env": {
            "type": "string",
            "enum": [
                "live",
                "test"
            ]
        },
        "prefix": {
            "type": "string"
        },
        "scopes": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "name": {
            "type": "string",
            "nullable": true
        },
        "secret": {
            "type": "string",
            "description": "Plaintext key \u2014 shown ONCE. Store in your server environment immediately."
        }
    }
}
DELETE /v1/account/keys/{id} Revoke an API key account:keys:delete

Parameters

InNameRequiredShape
pathidyes{"type":"string","pattern":"^k_[A-Za-z0-9]{22}$"}

Responses

200 — Key revoked; it will not authenticate further calls.

{
    "type": "object",
    "properties": {
        "object": {
            "type": "string",
            "const": "api_key"
        },
        "id": {
            "type": "string"
        },
        "revoked": {
            "type": "boolean"
        }
    }
}

Scopes

ScopeDescription
tenant:readRead the tenant, plan, balance, limits.
shops:readList and read shops.
shops:writeCreate and update shops.
sessions:readList and read payment sessions and their events.
providers:readList provider connections.
rotations:readRead rotation rules per shop.
rotations:writeUpsert the rotation rule for a shop.
webhooks:readRead the outgoing webhook delivery queue.
events:readRead the tenant audit log.
account:keys:readList API keys of the tenant (never their plaintext).
account:keys:writeCreate new API keys. The secret is shown ONCE in the create response.
account:keys:deleteRevoke an API key. Further calls with it get 401 invalid_key.

Errors

Every error answer has {error:{type,code,message,doc_url,request_id,param?}}. code is stable across versions. The anchor id on each row is the #code fragment of doc_url.

CodeHTTPType
authentication_required401
invalid_key401
live_mode_disabled403
scope_insufficient403
invalid_request400
invalid_body400
missing_field400
invalid_field400
https_required400
route_not_found404
method_not_allowed405
not_found404
conflict409
rate_limited429
plan_quota_exceeded429
server_error500
service_unavailable503