# Create a new online transaction with both users

This endpoint is an optimised call that allows a transaction to
be created and joined in a single request. It requires the
online user to have granted the basic_tx:offline_create_join scope
to the client that is performing the request.
This endpoint allows creating a transaction with both buyer and seller
as guest or full users, or one party to be guest user and the other full user.

Endpoint: POST /api/v1/me/transactions/create_with_guest_user
Version: 0.1.0
Security: APIKey

## Header parameters:

  - `Trustap-User` (string)
    Required in client flows, where you make API calls on behalf of another Trustap user.

## Request fields (application/json):

  - `buyer_id` (string, required)
    The id of the buyer for this transaction
(it can be full user id or guest user id).
    Example: "1-bd5bb99j-95bf-87e2-ce0d-95e7541c6ad5"

  - `charge` (integer, required)
    The charge value returned from a request to
/charge.
    Example: 78

  - `charge_calculator_version` (integer, required)
    The charge_calculator_version value returned from a request to /charge.
    Example: 5

  - `charge_config` (integer)
    The charge config for which the charge amount is computed.
    Example: 1

  - `charge_seller` (integer)
    The seller charge value returned from a
request to /charge.

  - `client_id` (string)

  - `creator_role` (string, required)
    Enum: "buyer", "seller"

  - `currency` (string, required)
    Enum: "aud", "eur", "gbp", "myr", "pln", "sek", "usd", "huf"

  - `description` (string, required)
    A description of the goods being sold.
    Example: "Soccer ticket"

  - `features` (array)
    features contains flags that modify the
transaction flow.
    Enum: "require_seller_acceptance", "use_hr_post", "use_shippo"

  - `image_url` (string)
    URL of the image displayed on the Trustap payment page to show the buyer
the item they are paying for.
Supports jpg, png, gif, bmp, webp and svg files. Images displayed as a
squares. Non-square images are cropped.

  - `payment_method` (string)
    The payment method to use for the transaction.
    Example: "bank_transfer"

  - `postage_fee` (integer)
    The custom postage fee, this fee only applies in the case
postage fee feature flag is enabled.

  - `price` (integer, required)
    The price of the goods being sold, in the
currency's smallest unit.  The charge value
should correspond to the Trustap charge created
with this price, otherwise this request will
fail with a 400 error.
    Example: 1234

  - `seller_id` (string, required)
    The id of the seller for this transaction
(it can be full user id or guest user id).
    Example: "ad5bb99f-85bf-47e1-be0d-15e7541c6ad7"

## Response 201 fields (application/json):

  - `amount_refunded` (integer)

  - `amount_released` (integer)

  - `buyer_id` (string)
    Example: "feb33a87-3917-4538-9260-127c8a6b5232"

  - `cancelled` (string)

  - `charge` (integer, required)
    Example: 78

  - `charge_buyer_client` (integer, required)

  - `charge_international_payment` (integer)

  - `charge_postage_buyer` (integer)

  - `charge_postage_client` (integer)

  - `charge_seller` (integer, required)

  - `charge_seller_client` (integer, required)

  - `claimed_by_buyer` (string)

  - `client_id` (string, required)
    Example: "trustap-app"

  - `complained` (string)

  - `complaint` (object)
    Example: {"description":"Item was fake"}

  - `complaint.description` (string, required)
    Example: "Item was fake"

  - `complaint_period_deadline` (string)

  - `complaint_period_ended` (string)

  - `created` (string, required)
    Example: "2019-12-25T09:00:00Z"

  - `currency` (string, required)
    The currency of the transaction. Note that, at present, the
buyer must pay using the transaction's currency and the
seller will be paid in the transaction's currency.
    Example: "eur"

  - `delivered` (string)
    Example: "2019-12-25T13:00:00Z"

  - `denied` (string)

  - `description` (string, required)
    Example: "Soccer ticket"

  - `funds_released` (string)
    Example: "2019-12-26T14:00:00Z"

  - `id` (integer, required)
    Example: 1309

  - `image_url` (string)
    URL of the image displayed on the Trustap payment page to show the buyer
the item they are paying for.
Supports jpg, png, gif, bmp and svg files. Images displayed as a squares.
Non-square images are cropped

  - `is_payment_in_progress` (boolean, required)
    If the transaction is paid via a delayed payment method,
such as SEPA debit, this field will be true until the
payment has fully succeeded or failed.

  - `join_code` (string)

  - `joined` (string)
    Example: "2019-12-25T10:00:00Z"

  - `listing_creator_accepted` (string)

  - `listing_creator_rejected` (string)

  - `listing_id` (string)
    If the transaction is created from a listing then this is
the ID of that listing; otherwise this property is omitted.

  - `listing_type` (string)
    Enum: "single_use", "multi_use"

  - `order_issue` (object)
    Example: {"description":"Delivery delayed"}

  - `order_issue.description` (string, required)
    Example: "Delivery delayed"

  - `order_issue_raised` (string)

  - `paid` (string)
    Example: "2019-12-25T11:00:00Z"

  - `payment_accepted` (string)

  - `payment_refunded` (string)

  - `posta_hr_tracking` (object)
    Example: {"barcode":"ABC123456","barcode_generated":"2019-12-26T14:00:00Z"}

  - `posta_hr_tracking.barcode` (string, required)
    Example: "ABC123456"

  - `posta_hr_tracking.barcode_generated` (string, required)
    Example: "2019-12-26T14:00:00Z"

  - `price` (integer, required)
    Example: 1234

  - `quantity` (integer, required)
    Example: 1

  - `refunds` (array)

  - `refunds.amount` (integer, required)

  - `refunds.id` (string, required)

  - `refunds.refunded` (string, required)

  - `released_to_seller` (boolean)

  - `review` (object)

  - `review.approved` (boolean)

  - `review.finished` (string)

  - `review.outcome_reason` (string)

  - `review.started` (string)

  - `review_flagged` (string)

  - `seller_id` (string)
    Example: "ad5bb99f-85bf-47e1-be0d-15e7541c6ad7"

  - `shippo_transaction_id` (string)

  - `status` (string, required)
    Example: "funds_released"

  - `tracked` (string)
    Example: "2019-12-25T12:00:00Z"

  - `tracking` (object)
    Example: {"carrier":"ups","tracking_code":"***"}

  - `tracking.carrier` (string, required)
    Example: "ups"

  - `tracking.tracking_code` (string, required)
    Example: "***"

  - `tracking_details_deadline` (string)

  - `tracking_details_window_started` (string)

## Response 400 fields (application/json):

  - `code` (string, required)
    Example: "negative_price"

  - `error` (string, required)
    A contextual description of the error that occurred. When
handling errors the code field should be used to determine
the type of error that occurred, as the text in the error
field may change unexpectedly.
    Example: "`price` cannot be negative"


