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) or Address City (null) (Address City)
Default: null

City of the merchant

CountryCodeEnum (string) or null
Default: null

Country code of the merchant

Address Lines (string) or Address Lines (null) (Address Lines)
Default: null

The address lines of the merchant

Address Postal Code (string) or Address Postal Code (null) (Address Postal Code)
Default: null

Postal code of the merchant

Bank Statement Email (string) or Bank Statement Email (null) (Bank Statement Email)
Deprecated
Default: null

The bank statement email of the merchant

Array of Bank Statement Email Addresses (strings) or Bank Statement Email Addresses (null) (Bank Statement Email Addresses)
Default: null

The bank statement email addresses of the merchant

CountryCodeEnum (string) or null
Default: null

Country code of the merchant

Display Name (string) or Display Name (null) (Display Name)
Default: null

The display name of the merchant

Due In Days (integer) or Due In Days (null) (Due In Days)
Default: null

The due in days

email
required
string <email> (Email)

The email of the merchant

Email Erp (string) or Email Erp (null) (Email Erp)
Default: null

The email for ERP of the merchant

Email Invoice (string) or Email Invoice (null) (Email Invoice)
Default: null

The email for invoices of the merchant

CurrencyEnum (string) or null
Default: null

The currency of the fees

Fixed Fee Per Order (string) or Fixed Fee Per Order (null) (Fixed Fee Per Order)
Default: null

The fixed fee per order

Gov Due In Days (integer) or Gov Due In Days (null) (Gov Due In Days)
Default: null

The government due in days

Id (string) or Id (null) (Id)
Default: null

Unique ID of the merchant

legal_name
required
string (Legal Name)

Legal name of the merchant

Logo Path (string) or Logo Path (null) (Logo Path)
Default: null

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

national_id
required
string (National Id)

National ID of the merchant

Partner (string) or Partner (null) (Partner)
Default: null

The partner's short name

Partner Id (string) or Partner Id (null) (Partner Id)
Default: null

The partner's ID

PartnerPPDetailsSchema (object) or null
Default: null

The payment provider details of the merchant

Percentage Fee Per Order (string) or Percentage Fee Per Order (null) (Percentage Fee Per Order)
Default: null

The percentage fee per order

Phone (string) or Phone (null) (Phone)
Default: null

Phone number of the merchant

Phone Invoice (string) or Phone Invoice (null) (Phone Invoice)
Default: null

Phone number for invoices of the merchant

short_name
required
string (Short Name)

Short name of the merchant

PayoutPlanEnum (string) or null
Default: null

The statement email cycle of the merchant

Vat Number (string) or Vat Number (null) (Vat Number)
Default: null

The VAT number of the merchant

Vat Registered (boolean) or Vat Registered (null) (Vat Registered)
Default: null

Whether the merchant is VAT registered

Website (string) or Website (null) (Website)
Default: null

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) or Address City (null) (Address City)
Default: null
CountryCodeEnum (string) or null
Default: null
Address Lines (string) or Address Lines (null) (Address Lines)
Default: null
Address Postal Code (string) or Address Postal Code (null) (Address Postal Code)
Default: null
Display Name (string) or Display Name (null) (Display Name)
Default: null
Email (string) or Email (null) (Email)
Default: null
Email Erp (string) or Email Erp (null) (Email Erp)
Default: null
Email Invoice (string) or Email Invoice (null) (Email Invoice)
Default: null
Legal Name (string) or Legal Name (null) (Legal Name)
Default: null
Logo Path (string) or Logo Path (null) (Logo Path)
Default: null

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

National Id (string) or National Id (null) (National Id)
Default: null
PartnerPPDetailsSchema (object) or null
Default: null
Phone (string) or Phone (null) (Phone)
Default: null
Phone Invoice (string) or Phone Invoice (null) (Phone Invoice)
Default: null
Vat Number (string) or Vat Number (null) (Vat Number)
Default: null
Vat Registered (boolean) or Vat Registered (null) (Vat Registered)
Default: null
Website (string) or Website (null) (Website)
Default: null
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": null,
  • "error_details": null,
  • "error_message": null,
  • "error_json": null,
  • "error_trace_id": null
}

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
{ }