Language

2Checkout Documentation

Create

You must specify your API username and password using the twocheckout.Api.credentials method before calling a method in this class.

Method

create

Use to create a coupon.

Arguments

  • dictionary Parameters

Returns

Returns a Python object.

Example Usage:

twocheckout.Api.credentials({'username':'APIuser1817037', 'password':'APIpass1817037'})

params = {
    'coupon_code': 'PYTEST12',
    'date_expire': '2020-12-12',
    'type': 'shipping'
    }

result = twocheckout.Coupon.create(params)

Example Response:

{
    'coupon_code': '7FYMUVA',
    'response_code': 'OK',
    'response_message': 'Coupon successfully created'
}