Two Marketplace API (1.0)

Download OpenAPI specification:Download

This API is for creating new merchants as a part of a marketplace setup using Two. The merchants that are onboarded through the markeplace are able to sell products or services with Two as the payment solution.

Note: Only authorised merchants will have access to use this API. Feel free to contact support@two.inc if you think this API might be relevant for your marketplace setup.

Specifically:

  • Sign up merchants with Two through your own solution
  • Get information about the registered Two merchants
  • Update information of registered Two merchant
  • Use the Two Checkout API with API keys for each inidividual merchant when creating and handling orders

Step 1: Create and onboard merchant with Two

Do a POST /v1/partner/<partner_id>/merchant with the required information to sign up a merchant with Two.

Keep note of the merchant's id in the response (hereby refered to as new_merchant_id) in the response. You can then use add X-Merchant-Id: <new_merchant_id> to requests that require X-Api-Key header and execute our endpoints on behalf of the merchant. For example:

GET /something
X-Api-Key: <your_api_key>
X-Merchant-Id: <new_merchant_id>

Step 2: Create order (Checkout API)

Do a POST /v1/order from the Checkout API with by using secret_api_key of the specific merchant as authentication.

Other:

  • Get all your marketplace merchants GET /v1/partner/<partner_id>/merchant
  • Get specific marketplace merchant GET /v1/partner/<partner_id>/merchant/<new_merchant_id>
  • Update specific marketplace merchant PATCH /v1/partner/<partner_id>/merchant/<new_merchant_id>

Note: All Checkout API features are available for the merchant onboarded with Two.

Environments

Marketplace

Create new marketplace merchant

This endpoint enables the partner / marketplace owner to create a new merchant who can sell products or services through Two.

SecurityX-Api-Key
Request
path Parameters
partner_id
required
string
Request Body schema: application/json
address_city
string (Address City)

City of the merchant

address_country_code
string (CountryCodeEnum)

Country code of the merchant

Enum: "AT" "BE" "CH" "CZ" "DE" "DK" "ES" "FI" "FR" "GB" "GR" "IE" "IT" "NO" "NL" "PL" "RO" "SE" "SI" "US"
address_lines
string (Address Lines)

The address lines of the merchant

address_postal_code
string (Address Postal Code)

Postal code of the merchant

bank_statement_email
string <email> (Bank Statement Email)
Deprecated

The bank statement email of the merchant

bank_statement_email_addresses
Array of strings <email> (Bank Statement Email Addresses)

The bank statement email addresses of the merchant

country_code
string (CountryCodeEnum)

Country code of the merchant

Enum: "AT" "BE" "CH" "CZ" "DE" "DK" "ES" "FI" "FR" "GB" "GR" "IE" "IT" "NO" "NL" "PL" "RO" "SE" "SI" "US"
display_name
string (Display Name)

The display name of the merchant

due_in_days
integer (Due In Days)

The due in days

email
required
string <email> (Email)

The email of the merchant

email_erp
string <email> (Email Erp)

The email for ERP of the merchant

email_invoice
string <email> (Email Invoice)

The email for invoices of the merchant

fee_currency
string (CurrencyEnum)

The currency of the fees

Enum: "NOK" "SEK" "GBP" "EUR" "USD" "DKK" "CHF" "RON" "PLN" "CZK"
fixed_fee_per_order
string <decimal> (Fixed Fee Per Order) ^-?[0-9]+(\.[0-9]{0,2})?

The fixed fee per order

gov_due_in_days
integer (Gov Due In Days)

The government due in days

id
string <uuid> (Id)

Unique ID of the merchant

legal_name
required
string (Legal Name)

Legal name of the merchant

logo_path
string (Logo Path)

The logo URL, valid extensions are: .png, .svg

national_id
required
string (National Id)

National ID of the merchant

partner
string (Partner)

The partner's short name

partner_id
string <uuid> (Partner Id)

The partner's ID

object (Payment Provider Details)

The payment provider details of the merchant

percentage_fee_per_order
string <decimal> (Percentage Fee Per Order) ^-?[0-9]+(\.[0-9]{0,6})?

The percentage fee per order

phone
string (Phone)

Phone number of the merchant

phone_invoice
string (Phone Invoice)

Phone number for invoices of the merchant

short_name
required
string (Short Name)

Short name of the merchant

statement_email_cycle
string (PayoutPlanEnum)

The statement email cycle of the merchant

Enum: "DAILY" "WEEKLY" "BI_MONTHLY" "MONTHLY"
vat_number
string (Vat Number)

The VAT number of the merchant

vat_registered
boolean (Vat Registered)

Whether the merchant is VAT registered

website
string (Website)

The website of the merchant

Responses
201

Merchant created

403

Access denied

409

Merchant already exists

default

Error response

post/v1/partner/{partner_id}/merchant
Request samples
application/json
{
  • "short_name": "testshortname",
  • "national_id": "13078389",
  • "legal_name": "Two B2B LIMITED",
  • "email": "test@two.inc",
  • "email_erp": "erp@two.inc",
  • "email_invoice": "invoice@two.inc",
  • "phone": "12345678",
  • "phone_invoice": "12345670",
  • "website": "https://two.inc",
  • "address_lines": "Test Square",
  • "address_city": "London",
  • "address_postal_code": "AED 12A",
  • "address_country_code": "GB",
  • "fixed_fee_per_order": "0.0",
  • "percentage_fee_per_order": "2.0",
  • "country_code": "GB",
  • "payment_provider_details": {
    }
}
Response samples
application/json
{
  • "account_enabled": true,
  • "account_executive": null,
  • "address_city": "OSLO",
  • "address_country_code": "NO",
  • "address_lines": "Testplass 1",
  • "address_postal_code": "1111",
  • "buyer_fallback_enabled": false,
  • "country_code": "NO",
  • "display_email": null,
  • "display_name": "Two AS",
  • "display_phone_number": null,
  • "due_in_days": null,
  • "email": "test@two.inc",
  • "email_erp": "erp@two.inc",
  • "email_invoice": "invoice@two.inc",
  • "fee_currency": "NOK",
  • "fixed_fee_per_order": "0.00",
  • "id": "3d26e5b2-3ee6-466f-96b3-5591500eb4fb",
  • "lead_type": null,
  • "legal_name": "Two AS",
  • "merchant_initiated_enabled": false,
  • "national_id": "925976105",
  • "onboarding_events": null,
  • "partner": "two",
  • "payee_accounts": [
    ],
  • "payment_provider_details": null,
  • "percentage_fee_per_order": "2.000000",
  • "phone": "+4712345678",
  • "phone_invoice": "+4712345670",
  • "platform_type": null,
  • "product_type": null,
  • "sales_development_rep": null,
  • "short_name": "testshortname",
  • "vat_number": null,
  • "vat_registered": false,
  • "web_developer": null,
  • "website": "https://two.inc"
}

Get all marketplace merchants

This endpoint enables the partner / marketplace owner to retrieve all merchants associated with the partner / marketplace owner.

SecurityX-Api-Key
Request
path Parameters
partner_id
required
string
Responses
200

Merchant

403

Access denied

404

Merchant not found

default

Error response

get/v1/partner/{partner_id}/merchant
Request samples
Response samples
application/json
[
  • {
    },
  • {
    }
]

Get marketplace merchant

This endpoint enables the partner / marketplace owner to retrieve information about the merchant ID associated with the partner / marketplace owner.

SecurityX-Api-Key
Request
path Parameters
merchant_id
required
string
partner_id
required
string
Responses
200

Merchant response

403

Access denied

404

Merchant not found

default

Error response

get/v1/partner/{partner_id}/merchant/{merchant_id}
Request samples
Response samples
application/json
{
  • "account_enabled": true,
  • "account_executive": null,
  • "address_city": "OSLO",
  • "address_country_code": "NO",
  • "address_lines": "Testplass 1",
  • "address_postal_code": "1111",
  • "buyer_fallback_enabled": false,
  • "country_code": "NO",
  • "display_email": null,
  • "display_name": "Two AS",
  • "display_phone_number": null,
  • "due_in_days": null,
  • "email": "test@two.inc",
  • "email_erp": "erp@two.inc",
  • "email_invoice": "invoice@two.inc",
  • "fee_currency": "NOK",
  • "fixed_fee_per_order": "0.00",
  • "id": "3d26e5b2-3ee6-466f-96b3-5591500eb4fb",
  • "lead_type": null,
  • "legal_name": "Two AS",
  • "merchant_initiated_enabled": false,
  • "national_id": "925976105",
  • "onboarding_events": null,
  • "partner": "two",
  • "payee_accounts": [
    ],
  • "payment_provider_details": null,
  • "percentage_fee_per_order": "2.000000",
  • "phone": "+4712345678",
  • "phone_invoice": "+4712345670",
  • "platform_type": null,
  • "product_type": null,
  • "sales_development_rep": null,
  • "short_name": "testshortname",
  • "vat_number": null,
  • "vat_registered": false,
  • "web_developer": null,
  • "website": "https://two.inc"
}

Update marketplace merchant

This endpoint enables the partner / marketplace owner to update the merchant ID associated with the partner / marketplace owner.

SecurityX-Api-Key
Request
path Parameters
merchant_id
required
string
partner_id
required
string
Request Body schema: application/json
address_city
string (Address City)
address_country_code
string (CountryCodeEnum)

An enumeration.

Enum: "AT" "BE" "CH" "CZ" "DE" "DK" "ES" "FI" "FR" "GB" "GR" "IE" "IT" "NO" "NL" "PL" "RO" "SE" "SI" "US"
address_lines
string (Address Lines)
address_postal_code
string (Address Postal Code)
display_name
string (Display Name)
email
string <email> (Email)
email_erp
string <email> (Email Erp)
email_invoice
string <email> (Email Invoice)
legal_name
string (Legal Name)
logo_path
string (Logo Path)

The logo URL, valid extensions are: .png, .svg

national_id
string (National Id)
object (PartnerPPDetailsSchema)
phone
string (Phone)
phone_invoice
string (Phone Invoice)
vat_number
string (Vat Number)
vat_registered
boolean (Vat Registered)
website
string (Website)
Responses
200

Success

403

Access denied

404

Merchant not found

default

Error response

patch/v1/partner/{partner_id}/merchant/{merchant_id}
Request samples
application/json
{
  • "national_id": "925976105",
  • "legal_name": "Two B2B LIMITED",
  • "email": "test@two.inc",
  • "email_erp": "erp@two.inc",
  • "email_invoice": "invoice@two.inc",
  • "phone": "12345678",
  • "phone_invoice": "12345670",
  • "website": "https://two.inc",
  • "address_lines": "Test Square",
  • "address_city": "London",
  • "address_postal_code": "AED 12A",
  • "address_country_code": "GB",
  • "payment_provider_details": {
    }
}
Response samples
application/json
{
  • "error_code": "string",
  • "error_details": "string",
  • "error_message": "string",
  • "error_json": [
    ],
  • "error_trace_id": "string"
}

Client specific API, Access is restricted, please speak to TWO support for more information

SecurityX-Api-Key
Responses
200

Client' specific JSON

403

Access denied

404

Merchant not found

default

Error response

get/v1/partner/iban_accounts
Request samples
Response samples
application/json
{ }