Skip to content

Latest commit

 

History

History
42 lines (33 loc) · 1.03 KB

init.md

File metadata and controls

42 lines (33 loc) · 1.03 KB
title Initialize repository
section api
sidebar true

POST /repositories/init

Create a Git repository for a payment request. Writes README and tags v1.

Guide: [How it works · Initialize]({{ '/guides/how-it-works/' | relative_url }})

Request body

Field Type Description
creator_user_id string Owner user id (must match auth)
payment_request_id string Payment request id

Response 200

{
  "repo_path": "/…/users/user-1/payment-requests/pr-100/repo",
  "commit_sha": "a1b2c3d4…",
  "version_tag": "v1"
}

Errors

  • 400 — repository already exists
  • 401 / 403 — auth / ownership
curl -sS -X POST "$BASE/repositories/init" \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-User-Id: user-1" \
  -H "Content-Type: application/json" \
  -d '{"creator_user_id":"user-1","payment_request_id":"pr-100"}'