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)
address_country_code
string (CountryCodeEnum)

An enumeration.

Enum: "NO" "SE" "GB" "US" "NL" "ES" "DK" "FR" "DE"
address_lines
string (Address Lines)
address_postal_code
string (Address Postal Code)
bank_statement_email
string <email> (Bank Statement Email)
bank_statement_email_addresses
Array of strings <email> (Bank Statement Email Addresses)
country_code
string (CountryCodeEnum)

An enumeration.

Enum: "NO" "SE" "GB" "US" "NL" "ES" "DK" "FR" "DE"
display_name
string (Display Name)
due_in_days
integer (Due In Days)
email
required
string <email> (Email)
email_erp
string <email> (Email Erp)
email_invoice
string <email> (Email Invoice)
fee_currency
string (CurrencyEnum)

An enumeration.

Enum: "NOK" "SEK" "GBP" "EUR" "USD" "DKK"
fixed_fee_per_order
string <decimal> (Fixed Fee Per Order) ^-?[0-9]+(\.[0-9]{0,2})?
gov_due_in_days
integer (Gov Due In Days)
id
string <uuid> (Id)
legal_name
required
string (Legal Name)
logo_path
string (Logo Path)
national_id
required
string (National Id)
partner
string (Partner)
object (PartnerPPDetailsSchema)
percentage_fee_per_order
string <decimal> (Percentage Fee Per Order) ^-?[0-9]+(\.[0-9]{0,6})?
phone
string (Phone)
phone_invoice
string (Phone Invoice)
portal_phone_numbers
Array of strings (Portal Phone Numbers)
short_name
required
string (Short Name)
statement_email_cycle
string (PayoutPlanEnum)

An enumeration.

Enum: "DAILY" "WEEKLY" "BI_MONTHLY" "MONTHLY"
vat_number
string (Vat Number)
vat_registered
boolean (Vat Registered)
website
string (Website)
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,
  • "portal_phone_numbers": 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,
  • "portal_phone_numbers": 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: "NO" "SE" "GB" "US" "NL" "ES" "DK" "FR" "DE"
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)
id
string <uuid> (Id)
legal_name
string (Legal Name)
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": [
    ]
}