Browse Payments

stable · api · 0.1.0

Issue an electronic Invoice

POST /api/v1/payment-transactions/{paymentTransactionId}/invoice-issuances

Capability Domain: Payments

Authentication

projectCredential (payments:write)

Scope: payments:write

Parameters and request body

  • paymentTransactionId — path, required
    paymentTransactionId schema
    {
        "type": "string",
        "format": "uuid"
    }
  • Idempotency-Key — header, required
    Idempotency-Key schema
    {
        "type": "string",
        "maxLength": 120
    }
  • X-Correlation-ID — header, optional
    X-Correlation-ID schema
    {
        "type": "string",
        "format": "uuid"
    }

Request schema

application/json

application/json request schema
{
    "type": "object",
    "additionalProperties": false,
    "required": [
        "customer_email",
        "items"
    ],
    "properties": {
        "customer_email": {
            "type": "string",
            "format": "email",
            "maxLength": 80
        },
        "customer_identifier": {
            "type": [
                "string",
                "null"
            ],
            "minLength": 8,
            "maxLength": 8
        },
        "customer_name": {
            "type": [
                "string",
                "null"
            ],
            "maxLength": 60
        },
        "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "name",
                    "count",
                    "unit",
                    "price",
                    "amount"
                ],
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 100
                    },
                    "count": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "unit": {
                        "type": "string",
                        "maxLength": 6
                    },
                    "price": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "amount": {
                        "type": "integer",
                        "minimum": 1
                    }
                }
            }
        }
    }
}

application/json request example

application/json request example
{
    "customer_email": "sandbox-buyer@example.test",
    "items": [
        {
            "name": "Sandbox item",
            "count": 1,
            "unit": "item",
            "price": 100,
            "amount": 100
        }
    ]
}

Responses and errors

StatusDescription
200Invoice Issuance outcome
401Invalid or revoked Project Credential
403Project Credential lacks the required scope
422Request violates the public contract

200 schema

200 response schema
{
    "type": "object",
    "required": [
        "data"
    ],
    "properties": {
        "data": {
            "type": "object",
            "required": [
                "id",
                "status"
            ],
            "properties": {
                "id": {
                    "type": "string",
                    "format": "uuid"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "processing",
                        "succeeded",
                        "failed"
                    ]
                }
            }
        }
    }
}

401 schema

401 response schema
{
    "type": "object",
    "required": [
        "error"
    ],
    "properties": {
        "error": {
            "type": "object",
            "required": [
                "code",
                "message",
                "retryable",
                "correlation_id",
                "details"
            ],
            "properties": {
                "code": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "retryable": {
                    "type": "boolean"
                },
                "correlation_id": {
                    "type": "string",
                    "format": "uuid"
                },
                "details": {
                    "type": "object"
                }
            }
        }
    }
}

403 schema

403 response schema
{
    "type": "object",
    "required": [
        "error"
    ],
    "properties": {
        "error": {
            "type": "object",
            "required": [
                "code",
                "message",
                "retryable",
                "correlation_id",
                "details"
            ],
            "properties": {
                "code": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "retryable": {
                    "type": "boolean"
                },
                "correlation_id": {
                    "type": "string",
                    "format": "uuid"
                },
                "details": {
                    "type": "object"
                }
            }
        }
    }
}

422 schema

422 response schema
{
    "type": "object",
    "required": [
        "error"
    ],
    "properties": {
        "error": {
            "type": "object",
            "required": [
                "code",
                "message",
                "retryable",
                "correlation_id",
                "details"
            ],
            "properties": {
                "code": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "retryable": {
                    "type": "boolean"
                },
                "correlation_id": {
                    "type": "string",
                    "format": "uuid"
                },
                "details": {
                    "type": "object"
                }
            }
        }
    }
}

200 example

200 response example
{
    "data": {
        "id": "73000000-0000-4000-8000-000000000007",
        "status": "succeeded"
    }
}

Idempotency

Requires Idempotency-Key. Retry the same Invoice Issuance with the same key and items.