Cowdidocs
API ReferenceInvoice financing

Attach an uploaded financing document

POST
/v1/financing/merchants/{merchantId}/documents

Attaches a document record after the client PUT the file to the presigned URL from POST .../uploads/presign. Requires merchant:financing.documents:write on the merchant. Returns 400 when upload_ref is expired or does not match this merchant, caller, and document type, or when the uploaded object is missing, oversized, or does not match the presigned content type and size. Returns 409 when the same upload has already been attached. Register the returned document as an invoice next, with POST .../invoices.

AuthorizationBearer <token>

Create a client with POST /v1/oauth/clients, then exchange its credentials for an access token. AUTHORIZATION_CODE clients act on behalf of a signed-in user and always use PKCE; CLIENT_CREDENTIALS clients act as themselves. A client may only be granted scopes its creator already holds — read the grantable list from GET /v1/oauth/clients/scopes.

In: header

Path Parameters

merchantId*string

Canonical sales-app merchant id, shared with Core. Legacy ids remain readable.

Length1 <= length <= 255

Request Body

application/json

Attach a document after the client PUT the file to the presigned upload URL.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/financing/merchants/01JZQ5W7M5Y83M6F1D6E0A2K8N/documents" \  -H "Content-Type: application/json" \  -d '{    "document_type": "INVOICE",    "upload_ref": "string"  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "type": "INVOICE",  "url": "http://example.com",  "file_name": "string",  "content_type": "image/jpeg",  "size_bytes": 1,  "uploaded_at": "2019-08-24T14:15:22Z"}
{  "code": "INVALID_PARAMS",  "description": "user_id must be a UUID",  "identifier": "string",  "invalid_params": [    {      "path": "user_id",      "reason": "must be a UUID",      "sub_code": "string"    }  ]}
{  "code": "INVALID_PARAMS",  "description": "user_id must be a UUID",  "identifier": "string",  "invalid_params": [    {      "path": "user_id",      "reason": "must be a UUID",      "sub_code": "string"    }  ]}
{  "code": "INVALID_PARAMS",  "description": "user_id must be a UUID",  "identifier": "string",  "invalid_params": [    {      "path": "user_id",      "reason": "must be a UUID",      "sub_code": "string"    }  ]}
{  "code": "INVALID_PARAMS",  "description": "user_id must be a UUID",  "identifier": "string",  "invalid_params": [    {      "path": "user_id",      "reason": "must be a UUID",      "sub_code": "string"    }  ]}
{  "code": "INVALID_PARAMS",  "description": "user_id must be a UUID",  "identifier": "string",  "invalid_params": [    {      "path": "user_id",      "reason": "must be a UUID",      "sub_code": "string"    }  ]}
{  "code": "INVALID_PARAMS",  "description": "user_id must be a UUID",  "identifier": "string",  "invalid_params": [    {      "path": "user_id",      "reason": "must be a UUID",      "sub_code": "string"    }  ]}
{  "code": "INVALID_PARAMS",  "description": "user_id must be a UUID",  "identifier": "string",  "invalid_params": [    {      "path": "user_id",      "reason": "must be a UUID",      "sub_code": "string"    }  ]}