ChargeCreate

POSThttps://api.twisto.cz/psp/v4/charges
POSThttps://api.twisto.pl/psp/v4/charges

Create a charge.

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer 123

Request body

  • authority: object
    • type: string
      required
      Allowed values: checkout_id 
    • value: string
      required
  • reference: string
    <= 140 characters
  • amount: string<decimal>
    required

    The amount of the charge (currently only the full amount is supported)

    Match pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
  • currency: string
    required

    ISO-4217 currency code

    >= 3 characters <= 3 characters
  • capture: boolean

    If true this will be a direct capture (active invoice as a result)

  • order: object
    • reference: string
      required
      <= 200 characters

Request Body example

{ "authority": { "type": "checkout_id", "value": "string" }, "reference": "string", "amount": "537.00", "currency": "str", "capture": true, "order": { "reference": "string" } }

Responses

Body

  • id: string
    required

    External ID of the charge

  • reference: string

    Order payment reference

  • amount: string<decimal>
    required

    Total amount

    Match pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
  • currency: string
    required

    ISO-4217 currency code

    >= 3 characters <= 3 characters
  • captured_amount: string<decimal>
    required

    Captured amount

    Match pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
  • refunded_amount: string<decimal>
    required

    Refunded amount

    Match pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
  • created_date: string<date-time>
    required

    Date when the order was created

  • receipt_number: string
    required

    Invoice external ID

  • product: string
    required

    Type of service

    Allowed values: Twisto Pay in three 
  • state: string
    required
    Allowed values: rejected authorised captured cancelled refunded error 

Response example

{ "id": "string", "reference": "string", "amount": "565.00", "currency": "str", "captured_amount": "919.00", "refunded_amount": "603.00", "created_date": "string", "receipt_number": "string", "product": "Pay in three", "state": "authorised" }