orderCreate

POSThttps://api.twisto.pl/psp/v2/order/

Determine authentication type and select correct handler to authenticate.

Security: Token Auth

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

Request body

  • service: string

    Type of utilized payment service

    Allowed values: twisto-pay pay-in-three 
  • order_external_id: string
    required

    External ID provided by PSP

    <= 36 characters
  • payment_identifier: string

    Unique payment identifier that is used as a reference in a banking system when we transfer funds in case that bulk payments are not enabled. It's generated randomly during order creation if not provided.

    <= 140 characters
  • return_url: string<uri>
    required

    A URL for subsequent redirection

  • order_data: object
    required

    Information about order

  • transaction_history: array[object]
    • date: string<date>
      required

      When was the transaction to be performed?

    • transaction_id: string
      required
    • eshop_external_id: string
      required

      E-shops ID provided by the PSP

      <= 36 characters
    • amount: string<decimal>
      required

      Historical order amount

      Match pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
    • mcc: integer

      MCC code used by PSP

    • is_canceled: boolean
      required

      Order has been cancelled by a customer

    • payment_type: string
      required

      A type of payment

      Allowed values: wire_transfer card cod other 
  • customer_data: object
    required

    Information about customer

  • items: array[object]
    • name: string
      required

      Name

      <= 255 characters
    • product_id: string

      Product ID

      <= 255 characters
    • quantity: integer
      required

      How many items of this type are in the order?

      >= 1
    • amount: string<decimal>
      required

      Price of a (single?) item

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

      VAT for a (single?) item

      Match pattern: ^-?\d{0,2}(?:\.\d{0,2})?$
    • type: string
      required
      Allowed values: goods shipment payment discount round 

Request Body example

{ "service": "twisto-pay", "order_external_id": "string", "payment_identifier": "string", "return_url": "http://api.example.org/accounts/?skip=400&limit=100", "order_data": { "eshop_external_id": "string", "amount": "502.00" }, "transaction_history": [ { "date": "2022-12-31", "transaction_id": "string", "eshop_external_id": "string", "amount": "5.00", "mcc": 175, "is_canceled": true, "payment_type": "wire_transfer" } ], "customer_data": { "email": "string", "first_name": "string", "phone_number": "string", "street_name": "string", "street_number": "string", "apartment_number": "string", "city": "string", "zipcode": "string", "country": "st", "personal_id": "string", "last_name": "string" }, "items": [ { "name": "string", "product_id": "string", "quantity": 57, "amount": "355.00", "vat": "438.00", "type": "goods" } ] }

Responses

Body

  • id: string<uuid>
    required

    Identifier

  • external_id: string
    required

    External order ID provided by Partner.

    <= 255 characters
  • redirect_url: string
    required

    A URL address to redirect to after the order request is processed

  • initial_amount: string<decimal>
    required

    Original value of order

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

    Current value of order after refunds

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

    How much was refunded

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

    When was the original order processed

  • status: string
    required

    Order status

    Allowed values: new data_completed checking rejected accepted canceled activated refunded error 
  • service: string
    required

    Type of utilized payment service

    Allowed values: twisto-pay pay-in-three 

Response example

{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "external_id": "string", "redirect_url": "string", "initial_amount": "240.00", "current_amount": "138.00", "refund_amount": "238.00", "date_settled": "string", "status": "new", "service": "pay-in-three" }