Cowdidocs
API ReferenceInvoice financing

Create a presigned financing-document upload

POST
/v1/financing/merchants/{merchantId}/uploads/presign

Issues a presigned S3 PUT URL for uploading one financing document. Requires merchant:financing.documents:write on the merchant. size_bytes is signed into the URL, so S3 rejects a PUT of a different size. PUT the file to url with the given content type before expires_at, then attach it with POST .../documents using the returned upload_ref.

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

Request a presigned S3 PUT URL for uploading one financing document.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/financing/merchants/01JZQ5W7M5Y83M6F1D6E0A2K8N/uploads/presign" \  -H "Content-Type: application/json" \  -d '{    "document_type": "INVOICE",    "content_type": "image/jpeg",    "size_bytes": 1  }'
{  "upload_ref": "string",  "url": "http://example.com",  "expires_at": "2019-08-24T14:15:22Z",  "content_type": "image/jpeg"}
{  "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"    }  ]}